1 | tbl_sex(scal_awl, tows)
|
scal_awl |
|
tows |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- Should be DIRECTLY executable !! ----
## The function is currently defined as
function (scal_awl, tows)
{
scal_awl %>%
left_join(tows, by = "tow_id") %>%
filter(!is.na(sex), size == "large") %>%
group_by(Bed, sex) %>%
summarise(n = n()) %>%
mutate(freq = round(n/sum(n) * 100, digits = 1)) %>%
group_by(Bed) %>%
mutate(N = sum(n)) %>%
spread(., sex, freq) %>%
dplyr::select(-N, everything(), -n) %>%
replace(is.na(.), 0) %T>%
write_csv(here::here(paste0("output/", YEAR, "/sex_tbl.csv")))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.