Raw Message
Message-ID: <496F0E0F.5040004@bitwrit.com.au>
Date: 2009-01-15T10:21:03Z
From: Jim Lemon
Subject: remove columns containing all zeros (or other value)
How about:
remove.constant.values<-function(x,MARGIN,value2remove) {
is.constant.line<-function(x,value2remove) { return(any(x!=value2remove)) }
return(unlist(apply(x,MARGIN,is.constant.line,value2remove)))
}
x[,remove.constant.values(x,2,0)]
Jim