Steven Lubitz <slubitz1 <at> yahoo.com> writes:

> Thank you - this is very helpful. However I realized that with my real data
sets (not the example I have here),
> I also have different numbers of columns in each data frame. rbind doesn't
seem to like this. Here's a
> modified example:
> 
> x <- data.frame(item1=c(NA,NA,3,4,5), item2=c(1,NA,NA,4,5),
item3=c(NA,2,NA,4,NA), id=1:5)
> y <- data.frame(item1=c(NA,2,NA,4,5,6), item2=c(NA,NA,3,4,5,NA), id=1:6)
> 
> rbind(x,y)

You should add dummy <NA> variables to each partial data frame
such that they look the same, and do the rbind later.

Dieter

______________________________________________
R-help@r-project.org 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.

Reply via email to