Package 'rfisheries'

Title: Programmatic Interface to the 'openfisheries.org' API
Description: A programmatic interface to 'openfisheries.org'. This package is part of the 'rOpenSci' suite (https://ropensci.org).
Authors: Karthik Ram [aut, cre], Carl Boettiger [aut], Andrew Dyck [aut]
Maintainer: Karthik Ram <[email protected]>
License: MIT + file LICENSE
Version: 0.2.99
Built: 2024-08-16 05:45:57 UTC
Source: https://github.com/ropensci/rfisheries

Help Index


country_code_data

Description

A dataset containing full list of Country Codes. Use this dataset if loading from the web is slow.

Usage

data(country_code_data)

Format

A data table with 239 rows and 2 variables


country_codes

Description

Function has been deprecated. Now replaced by of_country_codes

Usage

country_codes()

landings()

Plots data for an rfisheries result

Description

Plots data for an rfisheries result

Usage

fish_plot(x, linecolor = "steelblue", linesize = 0.9, title = NULL, ...)

Arguments

x

A landings dataset belonging to either a species or a country.

linecolor

Default line color is steelblue

linesize

Default line size is 0.9

title

Plot title. Title is generated based on species or country code. Specify one here only if you need something else.

...

additional arguments

Examples

## Not run: 
fish_plot(of_landings(country = 'CAN'))
fish_plot(of_landings(species = 'COD'))

## End(Not run)

Download full list of ISO-3166 alpha 3 country code.

Description

Function returns a data frame with country name and iso3c code which is required by the landings function to return country specific data

Usage

of_country_codes(foptions = list())

Arguments

foptions

additional curl options

Value

data.frame

Examples

## Not run: 
of_country_codes()

## End(Not run)

Returns landings data from the openfisheries API

Description

The function returns aggregate landings data if no parameters are supplied. One could get country or species-specific data by specifying either one of those options. Country must be provided as the iso3c code and species must be supplied as a3_code. Supporting functions country_codes and species_codes provide that data and can be combined to return data for multiple countries or species.

Usage

of_landings(country = NA, species = NA, foptions = list())

Arguments

country

Default is NA. Download country specific data by specifying the ISO-3166 alpha 3 country code.

species

Default is NA. Download species specific data by specifying the three-letter ASFIS species code

foptions

additional optional parameters

Value

data.frame

Examples

## Not run: 
of_landings()
# Landings by country
of_landings(country = 'CAN')
#landings by species
of_landings(species = 'COD')

## End(Not run)

Download species data including three-letter ASFIS species code.

Description

Returns a data frame with scientific_name, taxocode, a3_code, isscaap, and English name. The a3_code is required by landings to return species specific landing data.

Usage

of_species_codes(foptions = list())

Arguments

foptions

additional optional parameters

Value

data.frame

Examples

## Not run: 
of_species_list <- of_species_codes()

## End(Not run)

Deprecated functions in rfisheries

Description


species_code_data

Description

A dataset containing full list of Species Codes. Use this dataset if loading from the web is slow.

Usage

data(species_code_data)

Format

A data table with 11562 rows and 5 variables


species_codes

Description

Function now replaced by of_species_code

Usage

species_codes()