Re: [R] Exclude when sd=0

2012-05-24 Thread David L Carlson
-project.org Subject: [R] Exclude when sd=0 How do I trim a matrix to exclude columns that have no standard deviation? Thanks, Chris [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Exclude when sd=0

2012-05-23 Thread Chris Burns
How do I trim a matrix to exclude columns that have no standard deviation? Thanks, Chris [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Exclude when sd=0

2012-05-23 Thread David Winsemius
On May 23, 2012, at 8:44 PM, Chris Burns wrote: How do I trim a matrix to exclude columns that have no standard deviation? mtx[ , as.logical(apply(mtx, 2, sd))] -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list

Re: [R] Exclude when sd=0

2012-05-23 Thread Jorge I Velez
Perhaps this? X[, apply(X, 2, sd) 1e-10] HTH, Jorge.- On Wed, May 23, 2012 at 8:44 PM, Chris Burns wrote: How do I trim a matrix to exclude columns that have no standard deviation? Thanks, Chris [[alternative HTML version deleted]]