On Aug 9, 2010, at 2:16 AM, Alexander Eggel wrote:
Using R, I would like to find out which Samples (S1, S2, S3, S4, S5)
fulfill
the following criteria:contain minimally one value (x, y or z)
bigger than
4. Any ideas? Thanks, Alex.
data
Sample x y z
1 S1 -0.3 5.3 2.5
2 S2 0.4 0.2 -1.2
3 S3 1.2 -0.6 3.2
4 S4 4.3 0.7 5.7
5 S5 2.4 4.3 2.3
data$Sample[apply(data[, -1], 1, function(xyz) any(xyz > 4))]
[1] "S1" "S4" "S5"
David Winsemius, MD
West Hartford, CT
______________________________________________
[email protected] 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.