> result <- data.frame(samp=samp, merged=ifelse(is.na(student2), student1,
student2))
> result
samp merged
1 A 25.50
2 B 29.40
3 C 22.00
4 D 34.30
5 E 13.60
6 F 10.50
7 G 19.70
8 H 20.22
9 I 17.00
10 J 12.90
>
Rich
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.