include_or_exclude.RdSpecify how to downsample using output of tow_fn. For simple random sampling, a proportion of tows should do. Utilized in the cleanup_by_species function.
include_or_exclude(df, proportions, replicate_num)List of dataframes with random assignments of which data to include
catch_split <- base::split(catch, catch$year) # This is catch data for 1 species
#> Error: object 'catch' not found
tows <- base::lapply(catch_split, tow_fn)
#> Error: object 'catch_split' not found
props <- as.data.frame(seq(from = 0.1, to = 1, by = 0.1))
names(props) <- "trawlid"
props <- base::rep(props, length(tows))
#> Error: object 'tows' not found
tows_assigned <- purrr::map2(tows, props, include_or_exclude, replicate_num = 10)
#> Error: object 'tows' not found