[R] how to 'stack' data frames?

pdb philb at philbrierley.com
Thu Jul 29 12:53:50 CEST 2010

I have 2 data frames (A & B) with some common column names.

A has 10 rows.
B has 20 rows.

How do I combine them so I end up with a data frame with 30 rows that only
contains the common columns.

I was trying 'merge' (Merge two data frames by common columns .....etc. )
but that is not giving me what I expect...

> a <- iris
> b <- iris
> c <-merge(a,b)
> NROW(a)
[1] 150
> NROW(c)
[1] 152

Why is there only 152 rows and not 300?

View this message in context: http://r.789695.n4.nabble.com/how-to-stack-data-frames-tp2306284p2306284.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list