Shortcut for initialisation of data's object model from a t3 or a avdth database.

data_model_initialisation(
  data_source = "t3_db",
  db_con,
  log_file = FALSE,
  log_path = NULL,
  log_name = "data_model_initialisation",
  periode_reference,
  countries,
  oceans,
  sample_type,
  trips_selected = NULL
)

Arguments

data_source

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

db_con

Database connection R object expected. Mandatory argument for data source "t3_db", "avdth_db" and "sql_query".

log_file

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

log_path

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

log_name

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

periode_reference

Object of class integer expected. Year(s) of the reference period coded on 4 digits. By default NULL.

countries

Object of class character expected. ISO code on 3 letters related to one or more countries. By default NULL.

oceans

Object of class integer expected. Ocean(s) related to data coded on 1 digit. By default NULL.

sample_type

(integer) Sample type identification (landing, observer, ...). By default NULL.

trips_selected

Object of class character expected. Additional parameter only used with data source "t3_db". Use trip(s) identification(s) for selected trip(s) kept in the query (by periode of reference and countries). By default NULL.

Value

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