Load and prepare data for model fitting

fm_load_data(
  species,
  fleet,
  fitted_data = c("biomass", "presabs"),
  survey_data,
  vmslogbook_data,
  study_domain,
  year_start,
  year_end,
  month_start,
  month_end,
  time_step = c("Month", "Quarter"),
  k,
  grid_xmin,
  grid_xmax,
  grid_ymin,
  grid_ymax,
  seed = 29510
)

Arguments

species

character Species of interest

fleet

character Fleet chosen according to the species of interest. A fleet is considered to have homogeneous catchability and targeting behavior.

fitted_data

character Type of the data to be fitted to the model (either `biomass` for biomass data - positive-continuous data - or `presabs` for presence-absence data). Default is `biomass`

survey_data

data.frame Dataframe containing the scientific (survey) data

vmslogbook_data

data.frame Dataframe containing the commercial (vmslogbook) data

study_domain

data.frame Dataframe containing the data describing the study area

year_start

integer Starting year

year_end

integer Ending year

month_start

integer Starting month

month_end

integer Ending month

time_step

character Time step for the model (either `Month` for monthly time step or `Quarter` for quarterly time step). Default is `Month`

k

numeric Parameter controlling the number of knots of the mesh. The higher the denser.

grid_xmin, grid_xmax, grid_ymin, grid_ymax

numeric Limitation of the grid for the spatial domain

seed

integer The seed controlling for random effect. Default is 29510.

Value

list A named list of all necessary outputs for model fitting (`fm_fit_model()`)

Examples

# \donttest{
# run part1
survey_data_file <- system.file("original_data",
                                "Solea_solea",
                                "survey_data.Rds",
                                package = "FishMap"
)

survey_data <- readr::read_rds(file = survey_data_file)

vmslogbook_data_file <- system.file("original_data",
                                    "Solea_solea",
                                    "vmslogbook_data.Rds",
                                    package = "FishMap"
)

vmslogbook_data <- readr::read_rds(file = vmslogbook_data_file)

study_domain_file <- system.file("original_data",
                                 "Solea_solea",
                                 "study_domain.Rds",
                                 package = "FishMap"
)

study_domain <- readr::read_rds(file = study_domain_file)

fm_data_inputs <- fm_load_data(species = "Solea_solea",
                               fleet = c("OTB_DEF_>=70_0","OTB_CEP_>=70_0","OTT_DEF_>=70_0"),
                               fitted_data = "biomass",
                               survey_data = survey_data,
                               vmslogbook_data = vmslogbook_data,
                               study_domain = study_domain,
                               year_start = 2018,
                               year_end = 2018,
                               month_start = 11,
                               month_end = 11,
                               time_step = "Month",
                               k = 0.25,
                               grid_xmin = -6,
                               grid_xmax = 0,
                               grid_ymin = 42,
                               grid_ymax = 48)
#> Running step 1 -loading data-
#> as(<dgCMatrix>, "dgTMatrix") is deprecated since Matrix 1.5-0; do as(., "TsparseMatrix") instead
#> Joining with `by = join_by(Year, Month)`
#> Joining with `by = join_by(Month, Year, Year_Month)`
#> Joining with `by = join_by(layer, cell)`
#> Joining with `by = join_by(layer, cell)`
#> Joining with `by = join_by(layer, cell)`
#> Step 1 -loading data-: 18.163 sec elapsed
# }