Extracts a dataset from a database or csv

data_extraction(
  type,
  data_connection = NULL,
  sql_name = NULL,
  csv_path = NULL,
  time_period = NULL,
  country = NULL,
  vessel_type = NULL,
  vessel_type_select = NULL,
  ocean = NULL,
  csv_output = FALSE
)

Arguments

type

character expected. dabase or csv.

data_connection

list expected. Output of the function postgresql_dbconnection, which must be done before using the data_extraction function.

sql_name

character. Name of the sql file, in fishi.

csv_path

character. Path of the csv.

time_period

integer expected. Period identification in year.

country

integer expected. Country codes identification. [Country referentials]

vessel_type

integer expected. Vessel type codes identification. [Vessel_type referentials]

vessel_type_select

character expected. engin or vessel_type.

ocean

integer expected. Ocean codes identification. [Oscean referentials]

csv_output

TRUE to obtain a csv document. FALSE by default.

Value

The function return ggplot R plot.