Re: [R] Simple one

2009-07-05 Thread JoK LoQ
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' colu

Re: [R] Simple one

2009-07-04 Thread jim holtman
mean(x[x[,'region'] == 'south', 'profit']) or if dataframe mean(x$profit[x$region == 'south']) or for all regions tapply(x$profit, x$region, mean) On Fri, Jul 3, 2009 at 6:55 PM, JoK LoQ wrote: > > Just a quickly beginner's question. > > I wanna find the mean only from the values from a column

[R] Simple one

2009-07-04 Thread JoK LoQ
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 -- View this message in context:

Re: [R] Simple one

2009-07-03 Thread Ben Bolker
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 >