Re: [R] combining dataframes with different numbers of columns

2006-11-07 Thread Denis Chabot
Thanks you very much Hadley, Stephen, and Sundar, your suggestions all solve my problem, even if the narrower dataframe contains variables that are new to the wider dataframe. I'm sure glad I took the time to write instead of pursuing with my ugly and time-consuming solution. Denis > Dear

Re: [R] combining dataframes with different numbers of columns

2006-11-07 Thread hadley wickham
> Or, try this: > > http://finzi.psych.upenn.edu/R/Rhelp02a/archive/77358.html It's interesting to compare your implementation: rbind.all <- function(...) { x <- list(...) cn <- unique(unlist(lapply(x, colnames))) for(i in seq(along = x)) { if(any(m <- !cn %in% colnames(x[[i]]))) {

Re: [R] combining dataframes with different numbers of columns

2006-11-07 Thread Sundar Dorai-Raj
hadley wickham said the following on 11/7/2006 8:46 PM: > On 11/7/06, Denis Chabot <[EMAIL PROTECTED]> wrote: >> Dear list members, >> >> I have to combine dataframes together. However they contain different >> numbers of variables. It is possible that all the variables in the >> dataframe with f

Re: [R] combining dataframes with different numbers of columns

2006-11-07 Thread Stephen D. Weigand
Denis, On Nov 7, 2006, at 8:30 PM, Denis Chabot wrote: > Dear list members, > > I have to combine dataframes together. However they contain different > numbers of variables. It is possible that all the variables in the > dataframe with fewer variables are contained in the dataframe with > more va

Re: [R] combining dataframes with different numbers of columns

2006-11-07 Thread hadley wickham
On 11/7/06, Denis Chabot <[EMAIL PROTECTED]> wrote: > Dear list members, > > I have to combine dataframes together. However they contain different > numbers of variables. It is possible that all the variables in the > dataframe with fewer variables are contained in the dataframe with > more variabl

[R] combining dataframes with different numbers of columns

2006-11-07 Thread Denis Chabot
Dear list members, I have to combine dataframes together. However they contain different numbers of variables. It is possible that all the variables in the dataframe with fewer variables are contained in the dataframe with more variables, though it is not always the case. There are key vari