Create R6 reference object class full_trips

Super class

t3::list_t3 -> full_trips

Methods

Inherited methods


Method create_full_trips()

Creation of full trip item from trips.

Usage

full_trips$create_full_trips(object_trips)

Arguments

object_trips

Object of type R6-trips expected. A R6 reference object of class trips.


Method add_activities()

Function for add activities in full trips object.

Usage

full_trips$add_activities(object_activities)

Arguments

object_activities

Object of type R6-activities expected. A R6 reference object of class activities.


Method filter_by_years_period()

Function for filter full trips by a year(s) period.

Usage

full_trips$filter_by_years_period(years_period)

Arguments

years_period

Object of class integer expected. Year(s) in 4 digits format.


Method add_elementarycatches()

Function for add elementary catches in full trips object.

Usage

full_trips$add_elementarycatches(object_elementarycatches)

Arguments

object_elementarycatches

Object of type R6-elementarycatches expected. A R6 reference object of class elementarycatches.


Method add_elementarylandings()

Function for add elementary landings in full trips object.

Usage

full_trips$add_elementarylandings(object_elementarylandings)

Arguments

object_elementarylandings

Object of type R6-elementarylandings expected. A R6 reference object of class elementarylandings.


Method add_wells_samples()

Function for add wells and samples caracteristics in full trips object.

Usage

full_trips$add_wells_samples(object_wells)

Arguments

object_wells

Object of type R6-wells expected. A R6 reference object of class wells.


Method rf1()

Process of Raising Factor level 1 (RF1).

Usage

full_trips$rf1(
  species_fao_codes_rf1 = c("YFT", "SKJ", "BET", "ALB", "MIX", "LOT"),
  species_fate_codes_rf1 = as.integer(c(6, 11)),
  vessel_type_codes_rf1 = as.integer(c(4, 5, 6)),
  rf1_lowest_limit = 0.8,
  rf1_highest_limit = 1.2,
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

species_fao_codes_rf1

Object of type character expected. By default YFT, SKJ, BET, ALB, MIX and LOT. Specie(s) FAO code(s) used for the RF1 process.

species_fate_codes_rf1

Object of type integer expected. By default 6 ("Retained, presumably destined for the cannery"). Specie(s) fate code(s) used for the RF1 process.

vessel_type_codes_rf1

Object of type integer expected. By default 4, 5 and 6. Vessel type(s).

rf1_lowest_limit

Object of type numeric expected. Verification value for the lowest limit of the RF1. By default 0.8.

rf1_highest_limit

Object of type numeric expected. Verification value for the highest limit of the RF1. By default 1.2.

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method rf2()

Process of Raising Factor level 2 (rf2).

Usage

full_trips$rf2(global_output_path = NULL, output_format = "eu")

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method conversion_weigth_category()

Process of logbook weigth categories conversion.

Usage

full_trips$conversion_weigth_category(
  global_output_path = NULL,
  output_format = "eu",
  referential_template = "observe"
)

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".


Method set_count()

Process for positive sets count.

Usage

full_trips$set_count(
  global_output_path = NULL,
  output_format = "eu",
  referential_template = "observe"
)

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".


Method set_duration()

Process for set duration calculation (in hours).

Usage

full_trips$set_duration(
  set_duration_ref,
  global_output_path = NULL,
  output_format = "eu",
  referential_template = "observe"
)

Arguments

set_duration_ref

Object of type data.frame or tbl_df expected. Data and parameters for set duration calculation (by year, country, ocean and school type, durations in minutes in the reference table, converted into hours for subsequent processings).

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".


Method time_at_sea()

Process for time at sea calculation (in hours).

Usage

full_trips$time_at_sea(
  global_output_path = NULL,
  output_format = "eu",
  referential_template = "observe"
)

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".


Method fishing_time()

Process for fishing time calculation (in hours).

Usage

full_trips$fishing_time(
  sunrise_schema = "sunrise",
  sunset_schema = "sunset",
  referential_template = "observe",
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

sunrise_schema

Object of class character expected. Sunrise caracteristic. By default "sunrise" (top edge of the sun appears on the horizon). See below for more details.

sunset_schema

Object of class character expected. Sunset caracteristic. By default "sunset" (sun disappears below the horizon, evening civil twilight starts). See below for more details.

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

Details

Available variables are:

  • "sunrise": sunrise (top edge of the sun appears on the horizon)

  • "sunriseEnd": sunrise ends (bottom edge of the sun touches the horizon)

  • "goldenHourEnd": morning golden hour ends(soft light, best time for photography)

  • "solarNoon": solar noon (sun is in the highest position)

  • "goldenHour": evening golden hour starts

  • "sunsetStart": sunset starts (bottom edge of the sun touches the horizon)

  • "sunset": sunset (sun disappears below the horizon, evening civil twilight starts)

  • "dusk": dusk (evening nautical twilight starts)

  • "nauticalDusk": nautical dusk (evening astronomical twilight starts)

  • "night": night starts (dark enough for astronomical observations)

  • "nadir": nadir (darkest moment of the night, sun is in the lowest position)

  • "nightEnd": night ends (morning astronomical twilight starts)

  • "nauticalDawn": nautical dawn (morning nautical twilight starts)

  • "dawn": dawn (morning nautical twilight ends, morning civil twilight starts)


Method searching_time()

Process for searching time calculation (in hours, fishing time minus sets durations).

Usage

full_trips$searching_time(global_output_path = NULL, output_format = "eu")

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method sample_length_class_ld1_to_lf()

Process for length conversion, if necessary, in length fork (lf). Furthermore, variable "sample_number_measured_extrapolated" of process 2.1 will converse in variable "sample_number_measured_extrapolated_lf" (Notably due to the creation of new lf classes during some conversions).

Usage

full_trips$sample_length_class_ld1_to_lf(
  length_step,
  global_output_path = NULL,
  output_format = "eu",
  referential_template = "observe"
)

Arguments

length_step

Object of type data.frame or tbl_df expected. Data frame object with length ratio between ld1 and lf class.

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".


Method sample_number_measured_extrapolation()

Process for sample number measured individuals extrapolation to sample number individuals counted.

Usage

full_trips$sample_number_measured_extrapolation(
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method sample_length_class_step_standardisation()

Process for step standardisation of lf length class.

Usage

full_trips$sample_length_class_step_standardisation(
  maximum_lf_class = as.integer(500),
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

maximum_lf_class

Object of type integer expected. Theorical maximum lf class that can occur (all species considerated). By default 500.

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method well_set_weigth_categories()

Process for well set weigth categories definition.

Usage

full_trips$well_set_weigth_categories(
  sample_set,
  global_output_path = NULL,
  output_format = "eu",
  referential_template = "observe"
)

Arguments

sample_set

Object of type data.frame expected. Data frame object with weighted weigh of each set sampled.

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

referential_template

Object of class character expected. By default "observe". Referential template selected (for example regarding the activity_code). You can switch to "avdth".


Method standardised_sample_creation()

Object standardised sample creation.

Usage

full_trips$standardised_sample_creation(
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method standardised_sample_set_creation()

R6 object standardised sample set creation.

Usage

full_trips$standardised_sample_set_creation(
  length_weight_relationship_data,
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

length_weight_relationship_data

Object of type data.frame or tbl_df expected. Data frame object with parameters for length weight relationship.

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method raised_factors_determination()

Raised factors determination for weigth sample set to set.

Usage

full_trips$raised_factors_determination(
  threshold_rf_minus10 = as.integer(500),
  threshold_rf_plus10 = as.integer(500),
  threshold_frequency_rf_minus10 = as.integer(75),
  threshold_frequency_rf_plus10 = as.integer(75),
  threshold_rf_total = as.integer(250),
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

threshold_rf_minus10

Object of type integer expected. Threshold limite value for raising factor on individuals category minus 10. By default 500.

threshold_rf_plus10

Object of type integer expected. Threshold limite value for raising factor on individuals category plus 10. By default 500.

threshold_frequency_rf_minus10

Object of type integer expected. Threshold limite frequency value for raising factor on individuals category minus 10. By default 75.

threshold_frequency_rf_plus10

Object of type integer expected. Threshold limite frequency value for raising factor on individuals category plus 10. By default 75.

threshold_rf_total

Object of type integer expected. Threshold limite value for raising factor (all categories). By default 250.

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method raised_standardised_sample_set()

Application of process 2.8 raised factors on standardised sample set.

Usage

full_trips$raised_standardised_sample_set(
  global_output_path = NULL,
  output_format = "eu"
)

Arguments

global_output_path

By default object of type NULL but object of type character expected if parameter outputs_extraction egual TRUE. Path of the global outputs directory. The function will create subsection if necessary.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).


Method path_to_level3()

Temporary link to the R object model with modelisation process.

Usage

full_trips$path_to_level3()


Method data_preparatory()

Data preparatory for the t3 modelling process (level 3).

Usage

full_trips$data_preparatory(
  inputs_level3 = NULL,
  inputs_level3_path = NULL,
  output_directory,
  periode_reference_level3 = NULL,
  target_year = as.integer(lubridate::year(Sys.time() - 1)),
  period_duration = 4L,
  target_ocean = NULL,
  distance_maximum = as.integer(5),
  number_sets_maximum = as.integer(5),
  set_weight_minimum = as.integer(6),
  minimum_set_frequency = 0.1,
  vessel_id_ignored = NULL
)

Arguments

inputs_level3

Object of type data.frame expected. Inputs of levels 3 (see function path to level 3).

inputs_level3_path

Object of type character expected. Path to the folder containing yearly data output of the level 1 and 2 (output of the function the path to level 3). If provide, replace the inputs_level3 object.

output_directory

Object of type character expected. Path of the outputs directory.

periode_reference_level3

Object of type integer expected. Year(s) period of reference for modelling estimation.

target_year

Object of type integer expected. Year of interest for the model estimation and prediction.Default value is current year -1.

period_duration

Object of type integer expected. number of years use for the modelling. The default value is 5

target_ocean

Object of type integer expected. The code of ocean of interest.

distance_maximum

Object of type integer expected. Maximum distance between all sets of a sampled well. By default 5.

number_sets_maximum

Object of type integer expected. Maximum number of sets allowed in mixture. By default 5.

set_weight_minimum

Object of type integer expected. Minimum set size considered. Remove smallest set for which sample could not be representative. By default 6 t.

minimum_set_frequency

Object of type numeric expected. Minimum threshold proportion of set in a well to be used for model training in the process. By default 0.1.

vessel_id_ignored

Object of type integer expected. Specify list of vessel(s) id(s) to be ignored in the model estimation and prediction .By default NULL.


Method random_forest_models()

Modelling proportions in sets througth random forest models.

Usage

full_trips$random_forest_models(
  output_level3_process1,
  num.trees = 1000L,
  mtry = 2L,
  min.node.size = 5,
  seed_number = 7L,
  small_fish_only = FALSE
)

Arguments

output_level3_process1

Object of type data.frame expected. Output table data_lb_sample_screened from process 3.1.

num.trees

Object of type integer expected. Number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times. The default value is 1000.

mtry

Object of type integer expected. Number of variables randomly sampled as candidates at each split. The default value is 2.

min.node.size

Object of type numeric expected. Minimum size of terminal nodes. Setting this number larger causes smaller trees to be grown (and thus take less time).The default value is 5.

seed_number

Object of type integer expected. Set the initial seed for the modelling. The default value is 7.

small_fish_only

Object of type logical expected. Whether the model estimate proportion for small fish only (< 10 kg).


Method models_checking()

Load each full model and compute figure and tables to check the model quality. Furthermore, create a map of samples used for each model and relationship between logbook reports and samples.

Usage

full_trips$models_checking(
  output_level3_process2,
  output_directory,
  output_format = "eu",
  plot_sample = FALSE,
  avdth_patch_coord = FALSE
)

Arguments

output_level3_process2

Object of type list expected. Outputs models and data from process 3.2.

output_directory

Object of type character expected. Outputs directory path.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

plot_sample

logical. Whether the sample figure is computed. Default value = F

avdth_patch_coord

parameter waiting for coordinate conversion patch from avdth database


Method data_formatting_for_predictions()

Formatting data for model predictions.

Usage

full_trips$data_formatting_for_predictions(
  inputs_level3,
  output_level3_process1,
  target_year,
  vessel_id_ignored = NULL,
  country_flag = NULL,
  input_type = "observe_database",
  small_fish_only = FALSE
)

Arguments

inputs_level3

Object of type data.frame expected. Inputs of levels 3 (see function path to level 3).

output_level3_process1

Object of type data.frame expected. Output table data_lb_sample_screened from process 3.1.

target_year

Object of type integer expected. The year of interest for the model estimation and prediction.

vessel_id_ignored

Object of type integer expected. Specify here vessel(s) id(s) if you want to ignore it in the model estimation and prediction .By default NULL.

country_flag

Three letters FAO flag code of country or countries to estimate catches.

input_type

Type of coding use in different databases. Default value is 'observe_database'. Values can be 'observe_database' or 'avdth_database'.

small_fish_only

Object of type logical expected. Whether the model estimate proportion for small fish only (< 10 kg).


Method model_predictions()

Model predictions for the species composition and computing of catches.

Usage

full_trips$model_predictions(
  output_level3_process2,
  output_level3_process4,
  output_directory,
  output_format = "eu",
  country_flag = NULL,
  ci = FALSE,
  ci_type = "all",
  Nboot = 50,
  plot_predict = FALSE
)

Arguments

output_level3_process2

Object of type list expected. Outputs from level 3 process 2 (random forest models).

output_level3_process4

Object of type list expected. Outputs from level 3 process 4 (data formatting for predictions).

output_directory

Object of type character expected. Outputs directory path.

output_format

Object of class character expected. By default "eu". Select outputs format regarding European format (eu) or United States format (us).

country_flag

Three letters FAO flag code of country or countries to estimate catches.

ci

Object of type logical expected. Logical indicating whether confidence interval is computed. The default value is FALSE as it is a time consuming step.

ci_type

Type of confidence interval to compute. The default value is "all". Other options are "set" for ci on each set, "t1" for ci on nominal catch by species, "t1-fmod" for ci on nominal catch by species and fishing mode "t2" and "t2-fmod" for ci by 1 degree square and month. A vector of several ci option can be provided. ci_type are computed only if the ci parameter is TRUE.

Nboot

Object of type numeric expected. The number of bootstrap samples desired for the ci computation. The default value is 10.

plot_predict

Object of type logical expected. Logical indicating whether maps of catch at size have to be done.


Method show_me_what_you_got()

Most powerfull and "schwifty" function in the univers for "open the T3 process" and manipulate in live R6 objects.

Usage

full_trips$show_me_what_you_got()


Method clone()

The objects of this class are cloneable with this method.

Usage

full_trips$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.