library(FishMap)

subfunctions of fm_load_data()

fm_build_domain_mesh_spde(): Build spatial domain and mesh

This function will construct the mesh of the spatial domain.

#' \dontrun{
#fm_build_domain_mesh_spde(
#     grid_limit = grid_limit,
#     resol = resol,
#     grid_projection = grid_projection,
#     study_domain = study_domain,
#     create_mesh = create_mesh,
#     k = k,
#     vmslogbook_data = vmslogbook_data,
#     study_domain_sf = study_domain_sf,
#     Alpha = Alpha
#     )
#' }

fm_shape_sci_data_st() : Shape scientific data

This fonction will shape the scientific data according to the selected time window and time step.

#' \dontrun{
# fm_shape_sci_data_st(
#   survey_data_0 = survey_data_0,
#   time.step_df = time.step_df,
#   grid_projection = "+proj=longlat +datum=WGS84",
#   gridpolygon_sf = domain_mesh_spde_outputs[["gridpolygon_sf"]],
#   scientific_observation = "CPUE",
#   Sci.obs_spp = NULL,
#   mesh = domain_mesh_spde_outputs[["mesh"]]
# )
#' }

fm_shape_vms_logbook_data_st() : Shape ‘VMS x logbook’ data

#' \dontrun{
# fm_shape_vms_logbook_data_st(
#     vmslogbook_data_0 = vmslogbook_data_0,
#     time.step_df = time.step_df,
#     grid_projection = grid_projection,
#     gridpolygon_sf = gridpolygon_sf,
#     loc_x = loc_x,
#     mesh = mesh
# )
#' }

fm_load_data() : prepare and load model inputs

This function prepares all the necessary output for the model fitting. It will filter and shape the observation data (VMS and scientific). It will generate the spatial mesh for the study domain. All outputs are reported as part of a named list.

#' \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)
#' }