-2

im currently trying to create a table of the following variables. I have a number of countries with total sales. I would like to create table with median, mean, stdev # of products that were sold on the horizontal axes and the countries on the vertical axis.

          median    mean    stdev   # prod

nl
Us Ca

when trying to use the summary code, I do not get the descriptives I need, and Also get them only separately, not in the form i would like to

David
  • 1
  • 2

1 Answers1

0

dplyr is the place to go for these types of summaries

df <- data.frame(col_name = c(10, 22, 53, 54, 59),col_name2 = c(20, 35, 47, 533, 6))



df %>%
summarize(mean = mean(col_name),
median = median(col_name),
std = sd(col_name)  )