[R] rbind for similar data frames

Gladys Castillo Jordán
Fri, 27 Aug 2004 11:52:32 -0000

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:

> data
     a   b   c
1    1   2   3
2    2   3   4
3    3   4   5
4    4   5   6
5    5   6   7
6    6   7   8
7    7   8   9
8    8   9  10
9    9  10  11
10  10  11  12
11 101 102 103
22 102 103 104
33 103 104 105
44 104 105 106
55 105 106 107

Any suggestion?
  Regard,
   Gladys

------------------------------------------------
Gladys Castillo Jordan
Departamento de Matem??tica
Universidade de Aveiro
Campus Universitario de Santiago
3810-193 Aveiro, Portugal
Phone: (351) 234-370359
Fax: (351) 234-382014
email: gladys at mat.ua.pt
HTTP: www.mat.ua.pt/gladys