tbl_sex:

Usage Arguments Examples

View source: R/sex.r

Usage

1
tbl_sex(scal_awl, tows)

Arguments

scal_awl
tows

Examples

 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")))
  }

ben-williams/scallopr documentation built on Nov. 4, 2019, 7:13 a.m.