Re: [R] column removing under certain conditions

2011-03-04 Thread Ivan Calandra
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

[R] column removing under certain conditions

2011-03-04 Thread Scheuringer Martin
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