Skip to content
Prev 4775 / 398506 Next

Merging data.frames

On Tuesday, March 07, 2000 5:40 PM, Richard Bilonick wrote:

            
The easiest way to to this, I think, is as follows:

if you have several data frames, dataframe1, dataframe2, . . . , dataframen,
you can merger them all into one dataframe by using the data.frame command
again with the individuaal data.frames as arguments:

	data.frame(dataframe1, dataframe2, . . . , dataframen)

here's a quick example:
a1 a2
1  4  6
2  4  6
3  4  6
a1 a2 b1 b2
1  1  2  3  4
2  1  2  3  4
3  1  2  3  4
a1 a2 b1 b2 a1 a2
1  1  2  3  4  1  2
2  1  2  3  4  1  2
3  1  2  3  4  1  2

I hope this helps.

Mark J. Lamias
Department of Statistics
Department of Political Science
Survey Methodology Program/Survey Research Center
Institute for Social Research - University of Michigan
426 Thompson Street, Room 315
Ann Arbor, Michigan 48104-2321
(734) 647-5381
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._