Displaying 1 result from an estimated 1 matches for "tp4652482p4652486".
2012 Dec 07
1
how to add a column from another dataset with "merge"
...<-data.frame(id=c(9,8,6,4,4,3,1))
d2<-data.frame(id=c(9,8,6),age=c(46,56,52))
# Left Merge
d<-merge(d1,d2,all.x=TRUE)
# Reorder
d[order(d$id,decreasing=TRUE),]
HTH
Pete
--
View this message in context: http://r.789695.n4.nabble.com/how-to-add-a-column-from-another-dataset-with-merge-tp4652482p4652486.html
Sent from the R help mailing list archive at Nabble.com.