0
$\begingroup$

My table of data looks like this image (but with many more lines):

enter image description here

I want to be able to find the mean age of each region, so the mean age for region SSC20790 and so on. I believe I can use the dplyr package?

$\endgroup$
0
$\begingroup$

Something like this for instance:

library(plyr)
ddply(data,'region',function(x) {mean(x$age)})
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.