Filter catch by species, create a vector of tows and give tows a random assignment to be resampled,

cleanup_by_species(
  catch,
  spp_info,
  seq_from = 0.1,
  seq_to = 1,
  seq_by = 0.1,
  tot_dataframes = 91,
  replicate_num = 10
)

Arguments

catch

full catch df

spp_info

A data frame containing information about the test species.

seq_from

A numeric value specifying the start of the sequence for data frames.

seq_to

A numeric value specifying the end of the sequence for data frames.

seq_by

A numeric value specifying the step size of the sequence for data frames.

tot_dataframes

the number of data frames you want to output. effort x replicates - (replicates - 1). 5x3-2

replicate_num

An integer specifying the number of replicates.

Value

List of resampled catch dataframes

Examples

catch <- surveyresamplr::noaa_nwfsc_catch
spp_list <- data.frame(
  srvy = "CA",
  common_name = "arrowtooth flounder",
  file_name = "arrowtooth_flounder",
  filter_lat_gt = 34,
  filter_lat_lt = NA,
  filter_depth = NA,
  model_fn = "total_catch_wt_kg ~ 0 + factor(year) + pass",
  model_family = "delta_gamma",
  model_anisotropy = TRUE,
  model_spatiotemporal = "iid, iid"
)
cleanup_by_species(
  catch = catch,
  spp_info = spp_info,
  seq_from = 0.1,
  seq_to = 1,
  seq_by = 0.1,
  tot_dataframes = 91,
  replicate_num = 10
)
#> Error in dplyr::filter(catch, common_name == spp_info$common_name):  In argument: `common_name == spp_info$common_name`.
#> Caused by error:
#> ! object 'spp_info' not found