On Sun, Aug 24, 2008 at 11:54 AM, Ben Bolker <[EMAIL PROTECTED]> wrote: > > > Wade Wall <wade.wall <at> gmail.com> writes: > >> I am trying to look for a way to eliminate columns that sum to zero. Any >> help would be appreciated. > > x_without_zero_cols <- x[,colSums(x)!=0]
Of course, depending on the nature of the columns, you may want to use a relative comparison for column sums that are close to zero. Checking for exact equality on the results of floating point computations often produces surprising false negatives. > If you want to make some return for this helpful advice, > you could take this information and add it to the "R tips" section > of the R wiki ( http://wiki.r-project.org ). > > cheers > Ben Bolker > > ______________________________________________ > 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. > ______________________________________________ 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.