Dear Martin,
I'm not sure I understood you well, because you basically have the
answer already...
What about this?
A[,apply(A, 2, function(x) median(x)>0), drop=FALSE]
(drop=FALSE ensures that you keep it as column even if only one column
is selected)
HTH,
Ivan
Le 3/4/2011 11:11, Scheurin
Dear collegues!
Given a matrix, I would like to remove columns, that do not fulfill a certain
condition. The condition is, that the median of the column is higher than a
certain value.
I've seen the help on removing NA columns, but I cannot figure out how to
change the function part of the st
2 matches
Mail list logo