search for: tp3766285p3779622

Displaying 1 result from an estimated 1 matches for "tp3766285p3779622".

2011 Aug 24
3
help with "by" command
Hello, I am a new user of R, and I'd be grateful if someone could help me with the following: I would like to compute the mean of variable "trust" in dataframe "foo", but separately for each level of variable V2. That is, I'd like to compute the mean of trust at each level of V2. I have done this: > tmp <- by(foo, foo$V2, function(x) mean(foo$trust, na.rm=T))