This function aims to correct directly in the data base samples with incorrect measure type

measure_type_correction(
  data_connection,
  start_year,
  end_year,
  program,
  ocean,
  country_code,
  species_group,
  species,
  sizemeasuretype_to_replace,
  sizemeasuretype_new,
  corrector,
  action,
  path_file = NULL
)

Arguments

data_connection

list expected. Either output of the function postgresql_dbconnection, which must be done before using the measure_type_control

start_year

integer expected. Starting year for the correction.

end_year

integer expected. Ending year for the correction.

program

character expected. Programs to be controlled. Example of the format for a program topiaid: "fr.ird.referential.ps.common.Program#1239832686262#0.31033946454061234"

ocean

character expected. Ocean to be controlled. Examples: 'Indian', 'Atlantic'...etc.

country_code

character expected. Countries on wich control will be made. Examples: 'FRA', 'MUS'...etc.

species_group

character expected. Specie group to correct.

species

character expected. Species code to correct. Examples: 'YFT', 'FAL'...etc.

sizemeasuretype_to_replace

character expected. Measure type of the sample we want to correct. Examples: 'FL', 'DW'...etc.

sizemeasuretype_new

character expected. Measure type to replace the incorrect one. Examples: 'FL', 'DW'...etc.

corrector

character expected. First letter of the corrector's first name and last name. Examples: 'JMartin' for Jeanne Martin

action

character expected. Type of action required when update queries are launched. COMMIT is used to definitively validate modifications and make them permanent in the database. ROLLBACK is used to undo changes made. Examples: 'JMartin' for Jeanne Martin

path_file

character expected. By default NULL. Path to save the final xlsx.

Value

The function returns a xlsx table.