Hi,
Consider the following example.
> a = c(1,2,3); b = c(4,5,6); c = cbind(a,b); c[(2 < c[,1]) & (c[,1] < 4),]
a b
3 6
So, the idea is to select rows for which the value in the first column is
between 2 and 4. This works, however, I don't like having to reference a
explicitly in this fashion, and just wondered if there was a preferred way
to accomplish the same thing. Ideally, I'd like to make use of a function.
Thanks, Faheem.
______________________________________________
[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.