On 08/30/2011 12:06 AM, Bert Gunter wrote:
Jim et. al:
This is the second time I've seen this "advice" recently. Use logical
indexing: which(), though not wrong, is superfluous:
x[ !x %in% c(0,255)] will do, rather than:
By golly, you're right, and it works even if x is a logical vector. I
should have checked the operator precedence.
Jim
______________________________________________
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.