Hello All, I am still a beginner with R, and I only have a week or two under my belt so far. I'm working with NHANES anthropometric data on stature. I have two sets of data that have different statistical weights. I'm trying to combine those two data sets into one "mega-set" while retaining each data point's individual weight. If you have any idea as to how this is done, please let me know or let me know where to start looking. I've heard of cbind and rbind commands, but I'm not sure if that would do the trick. Thanks, Brian -- View this message in context: http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2543167.html Sent from the R help mailing list archive at Nabble.com.
On Sep 16, 2010, at 8:33 PM, btpagano wrote:> > Hello All, > > I am still a beginner with R, and I only have a week or two under my > belt so > far. > > I'm working with NHANES anthropometric data on stature. I have two > sets of > data that have different statistical weights. I'm trying to combine > those > two data sets into one "mega-set" while retaining each data point's > individual weight.Are you working with the Continuous NHANES datasets? If so, which ones? Do you have them in R objects? If so can you provide the results of str() on two that you want to merge? -- David.> > If you have any idea as to how this is done, please let me know or > let me > know where to start looking. I've heard of cbind and rbind > commands, but > I'm not sure if that would do the trick. > > Thanks, > > Brian > -- > View this message in context: http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2543167.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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.David Winsemius, MD West Hartford, CT
Good News! I think I figured out my problem. The command I was looking for was append(). Thank you for your help, Brian -- View this message in context: http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2544125.html Sent from the R help mailing list archive at Nabble.com.
On Sep 17, 2010, at 12:42 PM, btpagano wrote:> > Good News! > > I think I figured out my problem. > > The command I was looking for was append().Er, maybe. It does appear that you could use append() but c() is much more the typical R way of concatenating objects like vectors and lists. The only advantage of append() over c() would appear to be the capacity for insertion of the second argument somewhere "in the middle" of the the first. The cbind and rbind functions are used for more complex objects like dataframes and matrices. -- David Winsemius, MD West Hartford, CT