Re: [R] list to Matrix - remove NAs von list.

2007-11-02 Thread jim holtman
Another alternative: do.call('cbind', l[!sapply(l, function(x)all(is.na(x)))]) On 11/2/07, Petr PIKAL <[EMAIL PROTECTED]> wrote: > Hi > > [EMAIL PROTECTED] napsal dne 02.11.2007 12:00:09: > > > Thanks, > > > > I have the case that there is a NA in the list. This should not be a > column. > > Bu

Re: [R] list to Matrix - remove NAs von list.

2007-11-02 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 02.11.2007 12:00:09: > Thanks, > > I have the case that there is a NA in the list. This should not be a column. > But na.omit(l) does not work for lists. How to remove NAs from a list? > > l <- list(c(1,2,3),NA,c(1,2,3)) > mat <- do.call(cbind, l) If number of

Re: [R] list to Matrix - remove NAs von list.

2007-11-02 Thread Markus Schmidberger
Thanks, I have the case that there is a NA in the list. This should not be a column. But na.omit(l) does not work for lists. How to remove NAs from a list? l <- list(c(1,2,3),NA,c(1,2,3)) mat <- do.call(cbind, l) Best Markus Dimitris Rizopoulos schrieb: > you can use do.call(), e.g., > > do.ca