Shortcut for initialisation of data's object model from a observe or a AVDTH database.

data_model_initialisation(
  data_source = "observe_database",
  database_connection,
  log_file = FALSE,
  log_path = NULL,
  log_name = "data_model_initialisation",
  years_period,
  flag_codes,
  ocean_codes,
  vessel_type_codes,
  species_fate_codes,
  sample_type_codes,
  trip_ids = NULL
)

Arguments

data_source

Object of class character expected. Identification of data source. By default "observe_database" but you can switch to "avdth_database".

database_connection

Database connection R object expected. Mandatory argument for data source "observe_database" and "avdth_database".

log_file

Object of class logical expected. By default FALSE. Initiation or not for log file creation.

log_path

Object of class character expected. By default NULL. Path of the log file directory.

log_name

Object of class character expected. By default "data_model_initialisation". Name of the log file.

years_period

Object of class integer expected. By default NULL. Year(s) of the reference time period coded on 4 digits. Mandatory for data source "observe_database" and "avdth_database".

flag_codes

Object of class character expected. By default NULL. Country(ies) code related to data extraction. Necessary argument for data source "observe_database" and "avdth_database".

ocean_codes

Object of class integer expected. By default NULL. Ocean(s) related to data coded on 1 digit. Necessary argument for data source "observe_database" and "avdth_database".

vessel_type_codes

Object of class integer expected. By default NULL. Vessel type(s) related to data extraction. Necessary argument for data source "observe_database" and "avdth_database".

species_fate_codes

Object of class integer expected. By default NULL. Specie fate(s) related to data extraction. Necessary argument for data source "observe_database" and "avdth_database".

sample_type_codes

Object of class integer expected. By default NULL. Sample type identification.

trip_ids

Object of class character expected. By default NULL. Additional parameter only used with data source "observe_database". Use trip(s) identification(s) for selected trip(s) kept in the query. This argument overrides all others arguments like "years_period", "country" or "ocean".

Value

The function return a list with two R6 reference object inside: one class "object_model_data" and the second class "object_full_trips".