Folks, I need an elegant way of creating frequency count and group by multiple variables. Output should be a dataframe. I know the answer lies somewhere in using dplyr and data.table which I am still learning. I tried this link but I want to do this using dplyr and data.table.
Here is the sample data from the same link -
ID <- seq(1:177)
Age <- sample(c("0-15", "16-29", "30-44", "45-64", "65+"), 177, replace = TRUE)
Sex <- sample(c("Male", "Female"), 177, replace = TRUE)
Country <- sample(c("England", "Wales", "Scotland", "N. Ireland"), 177, replace = TRUE)
Health <- sample(c("Poor", "Average", "Good"), 177, replace = TRUE)
Survey <- data.frame(Age, Sex, Country, Health)
Here is the output I am looking for. Thanks and appreciate your help!