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
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
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:
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
>
4 matches
Mail list logo