Re: [R] Exclude when sd=0

2012-05-24 Thread David L Carlson
May 23, 2012 7:45 PM > To: r-help@r-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]] > > _

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]] > >

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 ht

[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 ht