sample_summary: Sample summary

View source: R/sample_summary.R

sample_summaryR Documentation

Sample summary

Description

Give the number of trip, vessel or well sampled for a given year. Need to define your goal in the parameter.

Usage

sample_summary(
  dataframe,
  data_type,
  graph_type = "number",
  reported_year = NULL,
  start_date = NULL,
  end_date = NULL,
  selected_country = NULL,
  selected_ocean = NULL,
  selected_harbour = NULL,
  selected_variable = "trip"
)

Arguments

dataframe

data.frame expected. Csv or output of the function data_extraction, which must be done before using the sample_summary() function.

data_type

character expected. 'tunabio' or 'observe'.

graph_type

character expected. 'number' or 'table'. Number by default.

reported_year

integer expected. Write the wanted year of the report.

start_date

character expected. if reported_year is not given. Write the start date of the time range of the report.

end_date

character expected. if reported_year is not given. Write the end date of the time range of the report

selected_country

integer expected. Country code to select the list of boat to count. If NULL give all the vessel for the given year.

selected_ocean

integer expected. Ocean code to select the list of boat to count. If NULL give all the vessel for the given year, works only for 'data_type' == 'observe'

selected_harbour

integer expected. Harbour code to select the list of boat to count. If NULL give all the vessel for the given year, works only for 'data_type' == 'observe'

selected_variable

character expected. Write the variable of the PSU. Can be "trip", "vessel" or "well". "trip" by default.

Details

The input dataframe frome sql must contain all these columns for the function to work [see referentials]:

   ocean_label | fleet | vessel_type_code | vessel_label | landing_year | departure  | port_departure | arrival     | port_arrival | total_landing
   ------------------------------------------------------------------------------------------------------------------------------------------
   Atlantic    | FRA   | 6                | VIA AVENIR   | 2022         | 2022-01-13 | ABIDJAN        | 2022-02-03  | ABIDJAN      |
   Atlantic    | FRA   | 6                | VIA AVENIR   | 2022         | 2022-01-13 | ABIDJAN        | 2022-02-03  | ABIDJAN      |
   Atlantic    | FRA   | 6                | VIA AVENIR   | 2022         | 2022-01-16 | ABIDJAN        | 2022-10-05  | ABIDJAN      |

add these columns to select the country and ocean (optional):

  • country_code

  • ocean_code

Value

The function return a table.


OB7-IRD/fishi documentation built on Feb. 4, 2025, 2:03 a.m.