[R] rbind for similar data frames

Thomas Petzoldt thpe at hhbio.wasser.tu-dresden.de
Fri Aug 27 14:15:17 CEST 2004


Gladys Castillo Jordán wrote:

> Hi all:
> I have a problem when I try to concatenate two similar data frames with
> different number of rows using rbind.  I did something like this:
> 
> 
>>d<-data.frame(a=1:10,b=2:11,c=3:12)
>>e<-data.frame(a=101:105,b=102:106,c=103:107)
>>data=rbind(d,e)
> 
> 
> The resulting row enumeration is not sequentially ordered as I expected:

[..]

> Any suggestion?

row.names(data)  <- 1:nrow(data)

Hope it helps

Thomas P.




More information about the R-help mailing list