[R] Merging multiple data sets
Hi, I am trying to merge data similar to the example data below dat0 idvar1var2var3 2 1 0 1 3 1 0 1 4 0 1 1 5 0 1 1 dat1 idvar4var5var6 2 1 0 1 3 1 0 1 6 0 1 1 7 0 1 1 dat2 idvar7var8var9 2 1 0 1 5 1 0 1 6 0 1 1 8 0 1 1 Basically what I'd like to do is combine these variables on id and create one large data frame that looks like the following. dat3 idvar1var2var3 var4var5 var6 var7 var8 var9 2 1 0 1 1 01 10 1 3 1 0 1 1 01 NA NA NA 4 0 1 1 NA NA NANA NA NA 5 0 1 1 NA NA NANA NA NA 6 NA NA NA 0 11 0 11 7 NA NA NA 0 11 NA NA NA 8 NA NA NA NA NA NA 011 How can I best do this in R? I've looked into merge but it excludes ids that aren't in all 3 data sets. -- View this message in context: http://r.789695.n4.nabble.com/Merging-multiple-data-sets-tp3620431p3620431.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.
[R] Determine package version in R
I have two versions of the lattice package installed on my computer. One is at /usr/local/lib/R/site-library and the other one is at /usr/lib/R/library. The one at the former location is the newer version and the one that I want to make sure get's loaded for my class. The reason that I have two versions installed is that the one in /usr/lib/R/library came in when I installed R in Debian, whereas the one in /usr/local/lib/R/site-library is one that I got from CRAN. How can I check to make sure that this version gets loaded or should I just run R CMD INSTALL lattice-x.y.z.tar.gz to /usr/lib/R/library? Chris -- View this message in context: http://www.nabble.com/Determine-package-version-in-R-tp20097045p20097045.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.