Skip to content
Prev 4790 / 398506 Next

Merging data.frames

On Wed, 8 Mar 2000, Richard A. Bilonick wrote:
What goes wrong with rbind?  It's supposed to work on data.frames
and there's a method rbind.data.frame()

R> d<-data.frame(a=1:10,b=2:11,c=3:12)
R> e<-data.frame(a=101:110,b=102:11,c=103:112)
R> rbind(d,e)
     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
12 102 103 104
13 103 104 105
14 104 105 106
15 105 106 107
16 106 107 108
17 107 108 109
18 108 109 110
19 109 110 111
20 110 111 112


	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._