0

I want to make a table of means and frequency in RStudio resembling this one:

Table by country

I have the exact same data as the authors of the article, but i cannot figure out how to do a resembling table in R without using excel.

Thanks!

Julie Ravn
  • 35
  • 3
  • You will get better answers if you provide the data and a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5965451#5965451) of what you have tried already. – Paul Rougieux Feb 23 '17 at 15:58

1 Answers1

0

You can use the dplyr package to do this

depending on the data the code can be something like

mydata %>%    
group_by(Gender, Country) %>%    
summarise(Age = mean(age),  Weight = mean(weight), n = n() [...])

There is a good tutorial for that: http://rpubs.com/justmarkham/dplyr-tutorial

Codutie
  • 1,055
  • 13
  • 25