Specify 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)

Arguments

df

tows data frame

proportions

proportions developed using: props <- as.data.frame(seq (0.1,1.0, by = 0.1)) replicated by the length of the tows dataframe. The name of the props is "trawlid".

replicate_num

going to be 10 for NWFSC and 3 for AK

Value

List of dataframes with random assignments of which data to include

Examples

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