[R] concatenate 2 data.frames

John Kane jrkrideau at yahoo.ca
Fri Mar 23 11:53:54 CET 2007


?rbind
 rbind(df1, df2)

This is a very basic question.  You probably would
save a lot of time if you read some of the
documentation on the CRAN site (not the home R page). 
Click on "Contributed"  on the left side of the screen
and have a look at some of the documentation there. 
There are some excellent materials there.  

I'd recommend perhaps looking at “Simple R” by John
Verzani and “A Guide for the Unwilling S User”  by
Patrick Burns.  R and S are basically equivalent for
this purpose.

Good luck and don't forget to read the posting guide.

--- João Fadista <Joao.Fadista at agrsci.dk> wrote:

> Dear all,
>  
> I would like to know how can I concatenate 2
> data.frames into a single one. Both data frames have
> the same number of columns and the same class type
> in each correspondent column. So what I want is to
> have a new data.frame where I have first the values
> from one data.frame and then the values from a
> second data.frame would came after in this new
> data.frame.
>  
> Thanks in advance.
>  
> 
> Med venlig hilsen / Regards
> 
> João Fadista
> Ph.d. studerende / Ph.d. student
> 
> 
>  	
>  	 AARHUS UNIVERSITET / UNIVERSITY OF AARHUS	
> Det Jordbrugsvidenskabelige Fakultet / Faculty of
> Agricultural Sciences	
> Forskningscenter Foulum / Research Centre Foulum	
> Genetik og Bioteknologi / Dept. of Genetics and
> Biotechnology	
> Blichers Allé 20, P.O. BOX 50	
> DK-8830 Tjele	
>  	
> Tel:	 +45 8999 1900	
> Direct:	 +45 8999 1900	
> Mobile:	 +45 	
> E-mail:	 Joao.Fadista at agrsci.dk
> <mailto:Joao.Fadista at agrsci.dk> 	
> Web:	 www.agrsci.dk <http://www.agrsci.dk/> 	
> ________________________________
> 
> Tilmeld dig DJF's nyhedsbrev / Subscribe Faculty of
> Agricultural Sciences Newsletter
> <http://www.agrsci.dk/user/register?lan=dan-DK> . 
> 
> Denne email kan indeholde fortrolig information.
> Enhver brug eller offentliggørelse af denne email
> uden skriftlig tilladelse fra DJF er ikke tilladt.
> Hvis De ikke er den tiltænkte adressat, bedes De
> venligst straks underrette DJF samt slette emailen.
> 
> This email may contain information that is
> confidential. Any use or publication of this email
> without written permission from Faculty of
> Agricultural Sciences is not allowed. If you are not
> the intended recipient, please notify Faculty of
> Agricultural Sciences immediately and delete this
> email.
> 
>  
> 
> 	[[alternative HTML version deleted]]
> 
> > ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list