clean_and_resample.RdThis function cleans up the catch data for a specific species and then performs resampling tests,
clean_and_resample(
spp_info,
catch,
seq_from = 0.1,
seq_to = 1,
seq_by = 0.1,
tot_dataframes = 91,
replicate_num = 10,
grid_yrs,
dir_out,
test = FALSE,
n_knots = 500,
model_type = "wrapper_sdmtmb",
bio = NULL
)A data frame row containing information about the species.
A data frame containing the catch data.
A numeric value specifying the start of the sequence for data frames.
A numeric value specifying the end of the sequence for data frames.
A numeric value specifying the step size of the sequence for data frames.
An integer specifying the total number of data frames to generate.
An integer specifying the number of replicates.
A data frame or list containing grid years information.
A character string specifying the directory for output files.
Logical. TRUE/FALSE. If TRUE, will only run first two resampling tests.
Numeric. Default = 500.
String. Default = "wrapper_sdmtmb", but can be any preset wrapper_*() function or a premade home built function.
A data frame containing the biological data, if applicable. NULL is default.
A list of data frames containing the cleaned and resampled catch data.
This function performs the following steps:
Cleans up the catch data for the specified species using `cleanup_by_species`.
Performs resampling tests on the cleaned data using `resample_tests`.
dir_out <- here::here("vignettes", "output")
catch <- surveyresamplr::noaa_nwfsc_catch
bio <- surveyresamplr::noaa_nwfsc_bio
grid_yrs <- replicate_df(
dat = surveyresamplr::noaa_nwfsc_catch, time_name = "year",
time_values = unique(catch$year)
)
#> Error in replicate_df(dat = surveyresamplr::noaa_nwfsc_catch, time_name = "year", time_values = unique(catch$year)): could not find function "replicate_df"
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"
)
clean_and_resample(
spp_info = spp_list,
catch,
seq_from = 0.1,
seq_to = 1,
seq_by = 0.1,
tot_dataframes = 91,
replicate_num = 10,
grid_yrs = grid_yrs,
dir_out = dir_out,
bio = bio
)
#> CA arrowtooth flounder
#> Error: object 'grid_yrs' not found