Re: [R] Fwd: help with "by" command

2011-08-30 Thread amalka
Thanks very much for the help. I ended up getting it to work with one small change: by(foo, foo$V2, function(foo) mean(foo$trust, na.rm=T)) thanks again, Ari -- View this message in context: http://r.789695.n4.nabble.com/help-with-by-command-tp3766285p3779622.html Sent from the R help mailing

[R] help with "by" command

2011-08-24 Thread amalka
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 th