Dear all,
I have some matrices which colSums are equal to zero and I would like to delete
all them.
How can I do that?
Kind regards,
miltinho
Brazil
__
[[alternative HTML version deleted]]
A - A[, colSums(A) != 0]
(untested)
Date: Thu, 26 Apr 2007 05:19:21 -0700 (PDT)
From: Milton Cezar Ribeiro [EMAIL PROTECTED]
Sender: [EMAIL PROTECTED]
Precedence: list
Dear all,
I have some matrices which colSums are equal to zero and I would like to
delete all them.
How can I do
I assume that you mean you want the columns deleted. If so, this might work:
set.seed(1)
x - matrix(sample(0:1,100,replace=TRUE,prob=c(.9,.1)), ncol=10)
x
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]001000100 0
[2,]000