seaaroundus (version 1.2.0)

catchdata: Get catch data for a region as a dataframe or stacked area chart

Description

Get catch data for a region as a dataframe or stacked area chart

Usage

catchdata(region, id, measure = "tonnage", dimension = "taxon",
  limit = 10, chart = FALSE, ...)

Arguments

region

(character) region type. one of: eez, lme, rfmo, highseas, fao, eez-bordering, fishing-entity, taxon, or global

id

(character/integer/numeric) region id. depends on what region is specified. See regions for details

measure

(character) the data measurement. one of "tonnage" or "value" (for "landed value"). Default: "tonnage"

dimension

(character) dimension data is bucketed on. one of "taxon", "commercialgroup", "functionalgroup", "country", "sector", "catchtype", "reporting-status", "layer" (for "data layer"). Default: "taxon"

limit

(numeric/integer) number of buckets of data plus one for "others". Default: 10

chart

(boolean) to return a chart versus a data frame Default: FALSE

...

curl options passed on to crul::HttpClient()

Value

data frame (or ggplot2 chart) with catch data for the requested region over time

Examples

Run this code
# NOT RUN {
catchdata("eez", 76)
head(catchdata("eez", 76, measure="value", dimension="reporting-status"))
catchdata("eez", 76, measure="value", dimension="sector")
catchdata("eez", 76, measure="value", dimension="taxon")
# }
# NOT RUN {
catchdata(region = "eez", id = 76, chart = TRUE)
# }

Run the code above in your browser using DataLab