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 statement, so that the function is only TRUE if the median of the column is higher than x; A[,apply(A, 2, function(x) all(x>=0))] Thank you very much, Regards! Martin Scheuringer --------------------------------- Mag. Martin Scheuringer Abteilung für Evidenzbasierte Wirtschaftliche Gesundheitsversorgung (EWG) Bereich Gesundheitsökonomie Evidence Based Economic Health Care Health Economics Hauptverband der österreichischen Sozialversicherungsträger Main Association of Austrian Social Insurance Insitututions Kundmanngasse 21 1031 Wien Tel.: +43-1-71132-3624 Fax.: +43-1-71132-3786 http://www.hauptverband.at P Save paper, do you really need to print this e-mail? [[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 http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.