data <- data[ , !apply(is.na(data), 2, all)] (or something like that)
G. On Thu, Feb 14, 2008 at 12:59:46PM +0000, Martin Waller wrote: > Hi, > > I guess this might be a FAQ or something, and there's probably a nice > simple way to do it, but I can't think of it: > > Given a matrix, I want to remove columns that are _entirely_ filled with > NAs (partial NAs are fine). > > How please? > > Thanks, > > Martin > > ______________________________________________ > 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. -- Csardi Gabor <[EMAIL PROTECTED]> UNIL DGM ______________________________________________ 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.