Give the number of each biological variable sampled for a given year.
species_biological_variable(
dataframe,
data_type,
graph_type = "table",
reported_year = NULL,
start_date = NULL,
end_date = NULL,
selected_variable = NULL,
selected_species = NULL
)
data.frame expected. Csv or output of the function data_extraction, which must be done before using the species_biological_variable() function.
character expected. 'tunabio' or 'observe'.
character expected. 'ggplot' or 'table'. table by default.
integer expected. Write the wanted year of the report
character expected. if reported_year is not given. Write the start date of the time range of the report.
character expected. if reported_year is not given. Write the end date of the time range of the report
character expected. 'weight', 'length' or 'sex'. If NULL give all the variable for the given year.
character expected. Name the species you want to select. Can be more than one. If NULL give all the species for the given year.
The function return ggplot or table R plot.
The input dataframe frome sql must contain all these columns for the function to work [see referentials]:
fishing_year | weight | length | sex | species_code | count
-------------------------------------------------------------------------------
2022 | 35.2 | 200 | 4 | SAI | 1
2022 | 9.93 | 44 | 2 | LKV | 1
2022 | 0.058 | 24 | 4 | REO | 1