Tuesday, February 5, 2013

Doing median and means in R

Let's say you have a dataframe d2 with fields industry, employee_range and multiplier. If you want to find the median of the field "multiplier" over a specific industry and employee_range you can use the subset function and specify the filter criterion

> median(subset(d2,industry=="Software & Technology" & employee_range=="Enterprise")$multiplier)
[1] 244659.3

No comments:

Post a Comment