I want to make a table of means and frequency in RStudio resembling this one:
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!
I want to make a table of means and frequency in RStudio resembling this one:
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!
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