View source: R/rl_population_trends.R
rl_population_trends | R Documentation |
Retrieve available population trend categories or species assessments for one or more trends.
rl_population_trends(
code = NULL,
year_published = NULL,
latest = NULL,
possibly_extinct = NULL,
possibly_extinct_in_the_wild = NULL,
scope_code = NULL,
page = 1
)
code |
Character or Numeric. One or more population trend codes ( |
year_published |
Optional. Single or numeric vector of years to filter assessments by publication year. |
latest |
Optional. Logical. If |
possibly_extinct |
Optional. Logical. Filter for species flagged as possibly extinct. |
possibly_extinct_in_the_wild |
Optional. Logical. Filter for species possibly extinct in the wild. |
scope_code |
Optional. Integer One or more scope codes to filter assessments. |
page |
Optional. Integer vector. Specify one or more page numbers to fetch.
If |
This function has two modes:
If code = NULL
, it returns a list of available population trend categories.
If code
is provided, it retrieves assessments for the specified trend(s),
optionally filtered by year, extinction status, scope, and page(s).
Population trends include: Increasing, Decreasing, Stable, or Unknown.
If page
is not specified, the function will automatically paginate over all
available pages for each parameter combination.
A tibble (class tbl_df
, tbl
, data.frame
) where each column represents a unique API response JSON key.
If code = NULL
, the tibble contains available population trend categories with columns such as code and description.
If code
is provided, the tibble contains assessment data for the specified trend(s), including population trend description,
population trend code, year, latest, and other relevant metadata.
## Not run:
# List all available population trend categories
rl_population_trends()
# Retrieve assessments for species with decreasing populations
rl_population_trends(code = "1")
# Get latest decreasing population assessments from 2020
rl_population_trends(
code = 2,
year_published = 2020,
latest = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.