| Title: | ArtFish for R |
|---|---|
| Description: | Set of functions in support of ArtFish implementation. |
| Authors: | Johanna Herfaut [aut], Yann Laurent [aut], Emmanuel Blondel [aut, cre] (ORCID: <https://orcid.org/0000-0002-5870-5762>), Alexandre Bennici [aut] (ORCID: <https://orcid.org/0000-0003-2160-3487>), Bracken Van Niekerk [ctb] |
| Maintainer: | Emmanuel Blondel <[email protected]> |
| License: | MIT |
| Version: | 0.1.20260701 |
| Built: | 2026-07-10 10:35:39 UTC |
| Source: | https://github.com/fdiwg/artfishr |
Produces a plot for the accuracy
accuracy_plot(sample = NULL, population, method = "higher")accuracy_plot(sample = NULL, population, method = "higher")
sample |
sample |
population |
population |
method |
method. Default is 'higher' |
artfish_accuracy
artfish_accuracy(n, N, method = "higher")artfish_accuracy(n, N, method = "higher")
n |
n |
N |
N |
method |
method |
artfish_estimates
artfish_estimates( data_effort = NULL, data_landing = NULL, ref_fishingunits = NULL, ref_species, year = NULL, month = NULL )artfish_estimates( data_effort = NULL, data_landing = NULL, ref_fishingunits = NULL, ref_species, year = NULL, month = NULL )
data_effort |
effort data |
data_landing |
landing data |
ref_fishingunits |
fishing units reference dataset |
ref_species |
species reference dataset |
the result of Artfish
artfish_estimates_by_fleet_segment
artfish_estimates_by_fleet_segment( data_effort = NULL, data_landing = NULL, ref_fishingunits = NULL, ref_species, year = NULL, month = NULL )artfish_estimates_by_fleet_segment( data_effort = NULL, data_landing = NULL, ref_fishingunits = NULL, ref_species, year = NULL, month = NULL )
data_effort |
effort data |
data_landing |
landing data |
ref_fishingunits |
fishing units reference dataset |
ref_species |
species reference dataset |
the result of Artfish
artfish_flouca_by_period
artfish_flouca_by_period( year = NULL, month = NULL, active_vessels, effort, effort_source = c("survey", "registry"), active_days = NULL, landings, minor_strata = NULL, validate = TRUE )artfish_flouca_by_period( year = NULL, month = NULL, active_vessels, effort, effort_source = c("survey", "registry"), active_days = NULL, landings, minor_strata = NULL, validate = TRUE )
active_vessels |
active vessels |
effort |
effort |
effort_source |
effort source whether it's derived from survey -B1- (fishers interviews) or registry -B2- (boat counting) |
active_days |
active days |
landings |
landings |
minor_strata |
minor_strata (to investigate further later) |
the result of Artfish for a given year/month
artfish_new
artfish_new( active_vessels = NULL, effort = NULL, effort_source = c("fisher_interview", "boat_counting"), active_days = NULL, landings = NULL, minor_strata = NULL )artfish_new( active_vessels = NULL, effort = NULL, effort_source = c("fisher_interview", "boat_counting"), active_days = NULL, landings = NULL, minor_strata = NULL )
active_vessels |
active vessels |
effort |
effort |
effort_source |
effort source whether it's derived from -B1- (fishers interviews) or -B2- (boat counting) |
active_days |
active days |
landings |
landings |
minor_strata |
minor_strata (to investigate further later) |
the result of Artfish
artfish_new_by_period
artfish_new_by_period( year = NULL, month = NULL, active_vessels, effort, effort_source = c("fisher_interview", "boat_counting"), active_days = NULL, landings, minor_strata = NULL, validate = TRUE )artfish_new_by_period( year = NULL, month = NULL, active_vessels, effort, effort_source = c("fisher_interview", "boat_counting"), active_days = NULL, landings, minor_strata = NULL, validate = TRUE )
active_vessels |
active vessels |
effort |
effort |
effort_source |
effort source whether it's derived from -B1- (fishers interviews) or -B2- (boat counting) |
active_days |
active days |
landings |
landings |
minor_strata |
minor_strata (to investigate further later) |
the result of Artfish for a given year/month
Accuracy toolbox shiny module server
artfish_shiny_accuracy_server(id, lang = NULL)artfish_shiny_accuracy_server(id, lang = NULL)
id |
id |
lang |
lang a reactive version of the language. Default is |
POC shiny module UI
artfish_shiny_accuracy_ui(id)artfish_shiny_accuracy_ui(id)
id |
id |
Server-side shiny logic to run Artfish computation as business service
artfish_shiny_computation_server( id, refresh, effort, effort_source, active_vessels, active_vessels_strategy, active_days, landings, minor_strata = NULL, progress_fn = NULL )artfish_shiny_computation_server( id, refresh, effort, effort_source, active_vessels, active_vessels_strategy, active_days, landings, minor_strata = NULL, progress_fn = NULL )
id |
Character string. Module namespace identifier. |
refresh |
refresher for computation |
effort |
effort data |
effort_source |
Character string indicating the type of effort source. |
active_vessels |
active vessels data |
active_vessels_strategy |
active vessels strategy |
active_days |
active days |
landings |
landings |
minor_strata |
Character string targeting a column name considered as minor strata. |
progress_fn |
A function to monitor progress |
Server-side logic for the ARTFISH Fishing Unit dashboard.
The *"Catch and effort - Detailed by fishing unit"* module provides a dedicated workspace for exploring key output metrics derived from artfish_compute_report, with a focus on one or multiple fishing units.
It enables users to analyse the evolution of fishing activity over time, with filtering options for fishing units and time range.
The module is composed of:
A selector panel to adjust the time range and fishing units to display
A set of KPIs presenting aggregated metrics for the selected period
Three boxed plots powered by fdishinyr::generic_chart allowing users to analyse ranked top items for:
(1) Species composition (by quantity)
(2) Fishing unit composition (by quantity)
(3) Fishing unit composition (by value)
Six boxed plots powered by fdishinyr::generic_chart allowing users to analyse key Artfish metrics:
(1) Total catch estimation
(2) Catch per unit effort (CPUE)
(3) Total nominal effort
(4) Activity coefficient
(5) Number of active vessels
(6) Total value estimation
artfish_shiny_fishing_unit_server( id, lang = NULL, estimate, effort_source, minor_strata = NULL, opts = list() )artfish_shiny_fishing_unit_server( id, lang = NULL, estimate, effort_source, minor_strata = NULL, opts = list() )
id |
Character string. Module namespace identifier. |
lang |
Optional language parameter. Can be either:
If |
estimate |
A reactive data frame aggregating the output of |
effort_source |
Reactive haracter string indicating the type of effort source.
Must be either |
minor_strata |
Reactive haracter string targeting a column name considered as minor strata. Not activated |
opts |
a named list of options.
For now limited to:
- |
User interface for the ARTFISH Fishing Unit Dashboard
artfish_shiny_fishing_unit_ui(id)artfish_shiny_fishing_unit_ui(id)
id |
Character string. Module namespace identifier. |
Server-side logic for the ARTFISH Overview dashboard.
The *"Total catch and effort - Statistics at country level"* module provides a high-level visualization of key output metrics derived from artfish_compute_report.
It acts as a dashboard to track the overall evolution of fishing activity over time, with the ability to filter by fishing units and time range.
The module is composed of:
A selector panel to adjust the time range and fishing units to display
A set of KPIs presenting aggregated country-level metrics for the selected period
Seven boxed plots powered by fdishinyr::generic_chart allowing users to analyse:
(1) Total catch estimation
(2) Species composition (by quantity)
(3) Total nominal effort
(4) Number of active vessels
(5) Total value estimation
(6) Species composition (by value)
(7) Catch per unit effort (CPUE)
artfish_shiny_overview_server( id, lang = NULL, estimate, effort_source = NULL, minor_strata = NULL, opts = list() )artfish_shiny_overview_server( id, lang = NULL, estimate, effort_source = NULL, minor_strata = NULL, opts = list() )
id |
Character string. Module namespace identifier. |
lang |
Optional language parameter. Can be either:
If |
estimate |
A reactive data frame aggregating the output of |
effort_source |
Reactive Character string indicating the type of effort source.
Must be either |
minor_strata |
Reactive Character string targeting a column name considered as minor strata. Not activated |
opts |
a named list of options.
For now limited to:
- |
User interface for the ARTFISH Overview Dashboard
artfish_shiny_overview_ui(id)artfish_shiny_overview_ui(id)
id |
Character string. Module namespace identifier. |
Server-side logic for the ARTFISH Report dashboard.
The *"Detailed results of Artfish computation – by stratum"* module provides an ergonomic view of key intermediate results and calculation steps underlying the Artfish algorithm for a given temporal unit.
The initial view displays a selector inviting the user to choose a year. If no year is available, the user must first compute at least one indicator using artfish_compute_report.
Successive dropdown lists then allow the user to select a month and a fishing unit before submitting the selection.
A complete report is displayed on the right-hand side.
The module is composed of:
A selector panel to choose the report to display by selecting year, month, and fishing unit
A button to validate the selection
A set of KPIs presenting the report status and the type of effort source
A gauge chart presenting the overall accuracy quality of the indicator
An ergonomic report view including intermediate steps and final indicators for the estimation of:
(1) Effort
(2) Landings
(3) Estimated catch by species
artfish_shiny_report_server( id, lang = NULL, estimate, effort_source, minor_strata )artfish_shiny_report_server( id, lang = NULL, estimate, effort_source, minor_strata )
id |
Character string. Module namespace identifier. |
lang |
Optional language parameter. Can be either:
If |
estimate |
A data frame aggregating the output of |
effort_source |
Character string indicating the type of effort source.
Must be either |
minor_strata |
Character string targeting a column name considered as minor strata. |
User interface for the ARTFISH Report Dashboard
artfish_shiny_report_ui(id)artfish_shiny_report_ui(id)
id |
Character string. Module namespace identifier. |
Server-side logic for the ARTFISH Species dashboard.
The *"Catch and effort - Detailed by species"* module provides a species-oriented workspace for exploring key output metrics derived from artfish_compute_report, with a focus on individual species caught.
The initial view displays a selector inviting the user to choose a species. The dropdown lists all species for which entries are available in the database. Users can then analyse the evolution of fishing activity over time, with filtering options for species, fishing units, and time range.
The module is composed of:
A selector panel to choose the species to display
A selector panel to adjust the time range and fishing units to display
Two boxed plots powered by fdishinyr::generic_chart allowing users to analyse, at species level:
(1) Fishing unit composition (by quantity)
(2) Target species ranking (by quantity)
A set of KPIs presenting aggregated metrics for the selected period
Five boxed plots powered by fdishinyr::generic_chart allowing users to analyse key Artfish metrics:
(1) Total catch estimation
(2) Catch per unit effort (CPUE)
(3) Total value estimation
(4) Average price
(5) Total nominal effort
artfish_shiny_species_server( id, lang = NULL, estimate, effort_source = NULL, minor_strata = NULL, opts = list() )artfish_shiny_species_server( id, lang = NULL, estimate, effort_source = NULL, minor_strata = NULL, opts = list() )
id |
Character string. Module namespace identifier. |
lang |
Optional language parameter. Can be either:
If |
estimate |
A reactive data frame aggregating the output of |
effort_source |
Reactive character string indicating the type of effort source.
Must be either |
minor_strata |
Reactive character string targeting a column name considered as minor strata. Not activated |
opts |
a named list of options.
For now limited to:
- |
User interface for the ARTFISH Species Dashboard
artfish_shiny_species_ui(id)artfish_shiny_species_ui(id)
id |
Character string. Module namespace identifier. |
POC shiny module server
artfish_shiny_welcome_server(id, lang = NULL)artfish_shiny_welcome_server(id, lang = NULL)
id |
id |
lang |
lang a reactive version of the language. Default is |
POC shiny module UI
artfish_shiny_welcome_ui(id)artfish_shiny_welcome_ui(id)
id |
id |
artfishr provides a set of utility tools to implement ArtFish methodology
Emmanuel Blondel [email protected]
Useful links:
Report bugs at https://github.com/fdiwg/artfishr/issues
Artfishr shiny server function
artfish_shiny_server(input, output, session)artfish_shiny_server(input, output, session)
Artfishr shiny ui function
artfish_shiny_ui(id)artfish_shiny_ui(id)
If it is set to zero or or is NA, the nb of active days in the period will be autogenerated
complete_active_days(active_days)complete_active_days(active_days)
active_days |
active days object of class tibble |
the curated active days table
Compute spatial and temporal accuracy for activity coefficient and cpue. Overall accuracy return the minimal value of the 4 accuracy indicators.
compute_accuracy( activity_coefficient, effort_estimate, cpue, sui, minor_strata = NULL )compute_accuracy( activity_coefficient, effort_estimate, cpue, sui, minor_strata = NULL )
activity_coefficient |
activity_coefficient |
effort_estimate |
effort_estimate |
cpue |
cpue |
minor_strata |
minor_strata. Default is |
a tibble object giving the different accuracy by strata
Computes catch estimate
compute_catch_estimate(effort_estimate, landings, minor_strata = NULL)compute_catch_estimate(effort_estimate, landings, minor_strata = NULL)
effort_estimate |
effort estimate computed with compute_effort_estimate |
landings |
landings |
minor_strata |
minor_strata. Default is |
a tibble giving the estimated catch by strata
Computes catch estimates by species
compute_catch_estimates_by_species( landings, catch_estimate, minor_strata = NULL )compute_catch_estimates_by_species( landings, catch_estimate, minor_strata = NULL )
landings |
landings |
catch_estimate |
result of catch estimate computed with compute_catch_estimate |
minor_strata |
minor_strata. Default is |
a tibble
The CPUE (Catch Per Unit of Effort) is computed from the landings, as the ratio
between nominal landed catches (catch_nominal_landed) and the effort fishing
duration (effort_fishing_duration).
The computation is performed grouped by a strata compound by year, month
and fishing_unit. This strata can be extended with additional columns with the
minor_strata argument.
Since landings give details data on landed species, nominal landed catches are sum grouped
by the strata and by fishing trip to get the total nominal landed catches by fishing trip.
Both catch_nominal_landed and effort_fishing_duration are then sum by strata
and the CPUE is computed as the ratio of these sum.
Note: Additional checks are performed to remove data with NAs.
compute_cpue(landings, minor_strata = NULL)compute_cpue(landings, minor_strata = NULL)
landings |
landings |
minor_strata |
minor_strata. Default is |
a tibble object giving the CPUE by strata
The activity coefficient is computed from the effort. Depending on the source of
effort data, the source information used is different:
- In the case of 'fisher_interview' the coefficient of activity is computed as the ratio
between the effort_fishing_duration and the effort_fishing_reference_period.
- In the case of 'boat_counting' the coefficient of activity is computed as the ratio
between the fleet_engagement_number and the fleet_engagement_max
The computation is performed grouped by a strata compound at minimum by the year,
month and fishing_unit. This strata can be extended by adding one or more
columns with the minor_strata argument.
Note: Additional check are performed to remove data with NAs, and ensure data consistency
compute_effort_activity_coefficient( effort, effort_source = c("fisher_interview", "boat_counting"), minor_strata = NULL )compute_effort_activity_coefficient( effort, effort_source = c("fisher_interview", "boat_counting"), minor_strata = NULL )
effort |
effort data |
effort_source |
effort |
minor_strata |
minor_strata. Default is |
a tibble object giving activity coefficient by strata
Computes nominal effort estimate
compute_effort_estimate( effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), landings, active_days = NULL, active_vessels = NULL, active_vessels_strategy = c("latest", "closest"), census_typology = NULL, minor_strata = NULL, progress_fn = NULL )compute_effort_estimate( effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), landings, active_days = NULL, active_vessels = NULL, active_vessels_strategy = c("latest", "closest"), census_typology = NULL, minor_strata = NULL, progress_fn = NULL )
The effort estimate is computed as the product of the fleet_engagement_number
(derived from the active_vessels), the effort_fishable_duration (derivated from
the active_days, and the effort_activity_coefficient computed with the
compute_effort_activity_coefficient function.
The computation of the nominal effort estimate is done grouped by strata compound of year, month
and fishing_unit. This strata can be extended with additional columns with the minor_strata argument.
Active vessels:
The active_vessels can be either time-dependent,ie given by year/month, year only
or be atemporal, mainly depending on how and at which frequency the vessels census/survey is
operated in the country.
An additional argument called active_vessels_strategy controls how to select the active_vessels data in time,
when this data is time-dependent. The latest strategy will select the latest data acquired in time, while the closest
will select the closest data acquired in time, which could be data acquired after the effort data considered.
As example, a vessel census is performed each five years, and data is available for 2007 and 2012. Effort data for 2011
needs to be computed. Which active_vessels data should be used? In case of a latest strategy, in 2011,
the latest data available is 2007, so this one will be used. In the case of a closest strategy, in 2011, we used
the closest vessel data (ie 2012), assuming it betters characterizes the fleet engagement for the year considered.
Active days:
In case of 'fisher_interview' (as source of the effort data), the active_days data should be ignored, as the days
of the month will be used (and generated automatically by the function)
compute_effort_estimate_with_FAO_Artfish( effort, effort_source = c("fisher_interview", "boat_counting"), landings, active_days = NULL, active_vessels, active_vessels_strategy = c("latest", "closest"), minor_strata = NULL, progress_fn = NULL )compute_effort_estimate_with_FAO_Artfish( effort, effort_source = c("fisher_interview", "boat_counting"), landings, active_days = NULL, active_vessels, active_vessels_strategy = c("latest", "closest"), minor_strata = NULL, progress_fn = NULL )
effort |
effort data |
effort_source |
effort_source (register_interview / boat_counting) |
landings |
landings |
active_days |
active_days. Default is |
active_vessels |
active vessels |
active_vessels_strategy |
The strategy to associate the active vessels to the effort based on time. Active vessels period does not match necessarily the periods of data (effort, landings), and can be reported either by year or by year/month. This parameter let decide which methodology should be used to select the active vessels based on time. It can be either "latest" (taking the latest period), "closest" ie the closest active vessels in time, after or before the data period. In case 2 periods before/after are equally closer, the latest in time before the data period will be taken. |
minor_strata |
minor_strata. Default is |
progress_fn |
a progress function with args (i, n, label). Default is |
TBD
compute_effort_estimate_with_IRD_Pechart( effort, effort_source = c("household_interview"), landings, active_days, census_typology, minor_stratum = NULL, progress_fn = NULL )compute_effort_estimate_with_IRD_Pechart( effort, effort_source = c("household_interview"), landings, active_days, census_typology, minor_stratum = NULL, progress_fn = NULL )
Johanna Herfaut
compute_report
compute_report( effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), active_vessels = NULL, active_vessels_strategy = NULL, active_days, landings, minor_strata = NULL, validate = FALSE, progress_fn = NULL )compute_report( effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), active_vessels = NULL, active_vessels_strategy = NULL, active_days, landings, minor_strata = NULL, validate = FALSE, progress_fn = NULL )
effort |
effort |
effort_source |
effort_source |
active_vessels |
active_vessels |
active_vessels_strategy |
active_vessels_strategy |
active_days |
active_days |
landings |
landings |
minor_strata |
minor_strata. Default is |
validate |
validate |
progress_fn |
a progress function with args (label, p). Default is |
the result of Artfish
Compute the sufficient uniformity index for effort and catch corresponding to the uniformity of sampling over the sampled days.
compute_sui(effort, landings, minor_strata = NULL)compute_sui(effort, landings, minor_strata = NULL)
effort |
effort |
landings |
landings |
minor_strata |
minor_strata. Default is |
a tibble object giving the different accuracy by strata
Generates an empty data frame following one of the artfishr format specifications.
create_artfish_template( format = c("artfish_A_active_vessels", "artfish_B1_effort", "artfish_B2_effort", "artfish_C_active_days", "artfish_D_landings"), include_meta = FALSE, save_as = NULL )create_artfish_template( format = c("artfish_A_active_vessels", "artfish_B1_effort", "artfish_B2_effort", "artfish_C_active_days", "artfish_D_landings"), include_meta = FALSE, save_as = NULL )
format |
Character string indicating which template to create. |
include_meta |
Logical; if TRUE, include schema metadata. |
save_as |
Optional file path to save the template as CSV. |
A zero-row data frame matching the schema definition.
[decode_artfish_schema()]
Family of functions to create empty templates for artfishr dataset types.
create_active_vessels_template(include_meta = FALSE, save_as = NULL) create_active_days_template(include_meta = FALSE, save_as = NULL) create_landings_template(include_meta = FALSE, save_as = NULL) create_effort_template( effort_source = c("boat_counting", "fisher_interview"), include_meta = FALSE, save_as = NULL )create_active_vessels_template(include_meta = FALSE, save_as = NULL) create_active_days_template(include_meta = FALSE, save_as = NULL) create_landings_template(include_meta = FALSE, save_as = NULL) create_effort_template( effort_source = c("boat_counting", "fisher_interview"), include_meta = FALSE, save_as = NULL )
These functions are convenience wrappers around [create_artfish_template()].
[create_artfish_template()], [decode_artfish_schema()]
Reads a JSON format specification (as used in inst/extdata/format_specs)
and returns an empty data frame with the appropriate column names.
decode_artfish_schema(json_path, include_meta = FALSE)decode_artfish_schema(json_path, include_meta = FALSE)
json_path |
Path to the JSON specification file. |
include_meta |
Logical; if TRUE, attaches metadata (e.g. name, title, urn) as attributes to each column. Default is FALSE. |
A data.frame with zero rows and the columns defined in the schema.
ERROR logger
ERROR(txt, ...)ERROR(txt, ...)
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
Function that generates a table of active days for all periods. The unique list of fishing units are inherited from available tables (active_vessels, effort, landings). In the same way, the list of minor strata values will be inherited based on the minor_strata columns available in data.
generate_active_days( effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), landings, active_vessels = NULL, minor_strata = NULL )generate_active_days( effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), landings, active_vessels = NULL, minor_strata = NULL )
effort |
effort table |
effort_source |
effort source |
landings |
landings table |
active_vessels |
active vessels table |
minor_strata |
minor strata. Default is |
an object of class tibble give active days
Function that generates a table of active days by year/month. The unique list of fishing units are inherited from available tables (effort, landings + eventually active_vessels). In the same way, the list of minor strata values will be inherited based on the minor_strata columns available in data.
generate_active_days_by_period( year, month, effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), landings, active_vessels = NULL, minor_strata = NULL )generate_active_days_by_period( year, month, effort, effort_source = c("fisher_interview", "boat_counting", "household_interview"), landings, active_vessels = NULL, minor_strata = NULL )
year |
year |
month |
month |
effort |
effort table |
effort_source |
effort source |
landings |
landings table |
active_vessels |
active vessels table |
minor_strata |
minor strata. Default is |
an object of class tibble give active days
Get FDI terms for Artfish inputs/outputs
get_fdi_terms()get_fdi_terms()
Get data validators powered by vrule
get_vrule_validators()get_vrule_validators()
the list of internal data validators as objects of class format_spec
INFO logger
INFO(txt, ...)INFO(txt, ...)
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
Gives the common column names between two tables. Util to be used
in dplyr *_join calls by argument to avoid explicit messages
triggered by dplyr when guessing the columns (in case by is not specified)
param x a data.frame or tibble
param y a data.frame or tibble
join_guess_by(x, y)join_guess_by(x, y)
Generic logger
logger(type = c("INFO", "WARN", "ERROR"), txt, ...)logger(type = c("INFO", "WARN", "ERROR"), txt, ...)
type |
type either INFO, WARN or DEBUG |
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |
Runs a Artfishr Shiny application
run_artfish_shiny(...)run_artfish_shiny(...)
Produces a plot for the sample size
sample_size_plot( sample = NULL, population, sample.mean, sample.sd, alpha = 0.1 )sample_size_plot( sample = NULL, population, sample.mean, sample.sd, alpha = 0.1 )
sample |
sample |
population |
population |
sample.mean |
mean |
sample.sd |
standard deviation |
alpha |
pvalue of t distribution |
Select active vessels for a selection of years
Active vessels:
The active_vessels can be either time-dependent,ie given by year/month, year only
or be atemporal, mainly depending on how and at which frequency the vessels census/survey is
operated in the country.
An additional argument called active_vessels_strategy controls how to select the active_vessels data in time,
when this data is time-dependent. The latest strategy will select the latest data acquired in time, while the closest
will select the closest data acquired in time, which could be data acquired after the effort data considered.
As example, a vessel census is performed each five years, and data is available for 2007 and 2012. Effort data for 2011
needs to be computed. Which active_vessels data should be used? In case of a latest strategy, in 2011,
the latest data available is 2007, so this one will be used. In the case of a closest strategy, in 2011, we used
the closest vessel data (ie 2012), assuming it betters characterizes the fleet engagement for the year considered.
select_active_vessels( periods, active_vessels, active_vessels_strategy = c("latest", "closest") )select_active_vessels( periods, active_vessels, active_vessels_strategy = c("latest", "closest") )
periods |
periods, list of unique years or year/month periods |
active_vessels |
active vessels object of class tibble |
active_vessels_strategy |
The strategy to associate the active vessels to the effort based on time. Active vessels period does not match necessarily the periods of data (effort, landings), and can be reported either by year or by year/month. This parameter let decide which methodology should be used to select the active vessels based on time. It can be either "latest" (taking the latest period), "closest" ie the closest active vessels in time, after or before the data period. In case 2 periods before/after are equally closer, the latest in time before the data period will be taken. |
a series of active vessels selection for the years considered (added as ref_period)
set_translation_language
set_translation_language(lang)set_translation_language(lang)
lang |
lang |
Set data validators powered by vrule
set_vrule_validators()set_vrule_validators()
Get translator
translator()translator()
the translator, object of class Translator
Family of functions to validate empty input dataset.
These functions are convenience wrappers around [validate_input_datasets()].
[validate_input_datasets()]
Validate input datasets
validate_input_datasets( active_vessels, effort, effort_source = c("fisher_interview", "boat_counting"), active_days = NULL, landings )validate_input_datasets( active_vessels, effort, effort_source = c("fisher_interview", "boat_counting"), active_days = NULL, landings )
active_vessels |
active vessels |
effort |
effort |
effort_source |
effort source whether it's derived from -B1- (fishers interviews) or -B2- (boat counting) |
active_days |
active days |
landings |
landings |
WARN logger
WARN(txt, ...)WARN(txt, ...)
txt |
a character vector of format strings, each of up to 8192 bytes. |
... |
any values to be passed into |