Possible Duplicate:
how to use merge() to update a table in R
What is the proper use of merge for this kind of operation in R? See below.
older <- data.frame(Member=c("first","second","third","fourth"),
VAL=c(NA,NA,NA,NA))
newer <- data.frame(Member=c("third","first"),
VAL=c(2125,4587))
#
merge.data.frame(older,newer,all=T)
Member VAL
1 first 4587
2 first NA
3 fourth NA
4 second NA
5 third 2125
6 third NA
That above is not exactly what I expect, I want to replace the older entries by newer ones, and not add another row. Like below. And I fail with merge.data.frame.
my.merge.fu(older,newer)
Member VAL
1 first 4587
2 second NA
3 third 2125
4 fourth NA
Kind of selective row replacement, where newer takes precedence and could not contain other Members than those in older.
Is there proper English term for such a R operation and is there prebuilt function for that?
Thank you.