Hi, I've got a bunch of datasets (each has an "ID" column) that I'd like to merge into one big datasets. After a google search I found http://tolstoy.newcastle.edu.au/R/help/05/08/11131.html . However, I'm wondering if there is an easy way to do this as I've got about 12 datasets to be merged (all in the same format: an "ID" column and a "Frequency" column")? Also, as I'm expecting more individual datasets to come in, I'm trying to automate my code so I don't have to keep manually adding in datasets into the merge() function. Any suggestions would be greatly appreciated. Cheers Kev Kevin Wang> Senior Advisor, Health and Human Services Practice > Government Advisory Services > > KPMG > 10 Shelley Street > Sydney NSW 2000 Australia > > Tel +61 2 9335 8282 > Fax +61 2 9335 7001 >kevinwang@kpmg.com.au> Protect the environment: think before you print > >[[alternative HTML version deleted]]
Wang, Kevin (SYD) wrote:> Hi, > > I've got a bunch of datasets (each has an "ID" column) that I'd like to > merge into one big datasets. > > After a google search I found > http://tolstoy.newcastle.edu.au/R/help/05/08/11131.html . However, I'm > wondering if there is an easy way to do this as I've got about 12 > datasets to be merged (all in the same format: an "ID" column and a > "Frequency" column")? Also, as I'm expecting more individual datasets > to come in, I'm trying to automate my code so I don't have to keep > manually adding in datasets into the merge() function. > > Any suggestions would be greatly appreciated.Try combining with ?Reduce, I think that should work. Some package has/had a merge.all or merge_all function at some point, too.
If your new datasets have similar measurements, you might consider rbind and adding a new column to distinguish the data sources. "Wang, Kevin (SYD)" <kevinwang at kpmg.com.au> wrote:>Hi, > >I've got a bunch of datasets (each has an "ID" column) that I'd like to >merge into one big datasets. > >After a google search I found >http://tolstoy.newcastle.edu.au/R/help/05/08/11131.html . However, I'm >wondering if there is an easy way to do this as I've got about 12 >datasets to be merged (all in the same format: an "ID" column and a >"Frequency" column")? Also, as I'm expecting more individual datasets >to come in, I'm trying to automate my code so I don't have to keep >manually adding in datasets into the merge() function. > >Any suggestions would be greatly appreciated. > >Cheers >Kev > >Kevin Wang >> Senior Advisor, Health and Human Services Practice >> Government Advisory Services >> >> KPMG >> 10 Shelley Street >> Sydney NSW 2000 Australia >> >> Tel +61 2 9335 8282 >> Fax +61 2 9335 7001 >> >kevinwang at kpmg.com.au > >> Protect the environment: think before you print >> >> > > > [[alternative HTML version deleted]] > >______________________________________________ >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.