Ben

 that subset(..) works, and it solves all my problems. thnks!



Ben Bolker wrote:
> 
> 
> 
> JoK LoQ wrote:
>> 
>> Just a quickly beginner's question. 
>> 
>> I wanna find the mean only from the values from a column related to
>> specific values from another one. Like, theres a 'region' column, i want
>> the mean of the value on 'profit' column only from "south" sells from
>> 'region' column
>> 
> 
> mean(x[x$region=="south",]$profit)
> 
> or  (untested)
> 
> mean(subset(x,region=="south",select=profit))
> 

-- 
View this message in context: 
http://www.nabble.com/Simple-one-tp24329691p24340559.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.

Reply via email to