R/get_empirical_freq.R

Defines functions get_empirical_freq

get_empirical_freq <- function(survey, location, gender, age) {
  empirical_dist <- survey %>%
    rename(location = location, gender = gender,  age = age) %>%
    group_by(location, age, gender) %>%
    summarise(n = n()) %>%
    ungroup() %>%
    dplyr::select(location, gender, age, n)
  return(empirical_dist)
}
essentialols/fbsamplR documentation built on Dec. 20, 2021, 6:39 a.m.