Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appending data in R

Tags:

r

dataset

I am producing a script where I have done many manipulations to a bunch of data and, I do these same manipulations to another dataset. Both data sets have the same rows, columns, and headers. I would like to be able to join the two data sets together where I place dataset A above dataset B. I wouldn't need to headers for dataset B and would instead just clump all of the data together as if they were never really separated in the first place. Is there a simply way to do this?

like image 907
Tim Avatar asked Jun 29 '11 05:06

Tim


2 Answers

Yes. Use rbind() command.

combineddataset = rbind(dataset1, dataset2)

Hope that helps.

like image 99
Curious2learn Avatar answered Oct 23 '22 09:10

Curious2learn


And for completeness, you could also use the rbind.fill function found in the plyr package.

like image 27
Btibert3 Avatar answered Oct 23 '22 08:10

Btibert3