> v=data.frame(c1=c("e","r","t"),v=c(1,4,2) ) > m=matrix(c("r","t","r","s","e",5,6,7,8,9),nr=5) > colnames(m)=c("c1","c2") > m=as.data.frame(m) > merge(v, m, by ="c1" ) c1 v c2 1 e 1 9 2 r 4 5 3 r 4 7 4 t 2 6
-- View this message in context: http://r.789695.n4.nabble.com/merge-verctor-and-matrix-tp2550280p2550315.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.