Skip to content
Prev 174956 / 398506 Next

"with" and "by" and NA:

On 25/03/2009 7:36 PM, Aldi Kraja wrote:
You don't need with() here, as you are explicitly extracting the vectors 
from x.
You could use with(), and extract the vectors from a subset of x:

with(x[!is.na(x$ph1),], by(ph1, cm1, mean))

This is untested.  If you had provided sample data in a usable format I 
would have tried it, but you didn't, and I'm too lazy to create my own.

Duncan Murdoch