species: Species Names or Code

View source: R/species.R

speciesR Documentation

Species Names or Code

Description

Converts species codes to corresponding species names and vice versa.

Usage

species(x, ...)

## S3 method for class 'foreign'
species(x, ...)

## Default S3 method:
species(x, ...)

## S3 method for class 'list'
species(x, ...)

## S3 method for class 'numeric'
species(x, language = "english", coding = "code", output, ...)

## S3 method for class 'character'
species(x, language = "english", coding = "code", drop = TRUE, ...)

Arguments

x

Numerical species code(s) or species name(s).

language

Character string specifying the language in which species names are to be returned. Either ‘english’, ‘french’ or ‘latin’. Note that not all language and coding combinations are available.

coding, input, output

Character string specifying the type of species coding being used. Options are the standard research survey coding ‘rv’ (or equivalently ‘research’), the Statistical Coordinating Committee for the Atlantic Coast (STACAC) coding ‘stacac’, the North American Fisheries Organization (NAFO) coding ‘nafo’, World Repository of Marine Species (WoRMS) coding ‘WoRMS’ or ‘aphiaID’, and the observer and commercial file name prefix coding ‘observer’ and ‘commercial’.

Value

Vector of character strings containing species names. For multiple species name searches, a list of search results are returned.

Functions

species

Generic species method.

species.foreign

Load foreign species code table.

species.default

Default species method.

species.list

Apply species function to list elements.

species.numeric

Convert numeric species code(s) to corresponding species name(s).

species.character

Find numeric species code(s).

species.str

Alias of species.numeric.

species.code

Alias of species.character.

See Also

taxon, data

Examples

# Miscellaneous queries:
species(10)  # Code for "Atlantic cod".
species(c(10, 12, 40:43), language = "latin") # Latin names for common species.
species(101, coding = "nafo")     # NAFO species codes.
species(145, coding = "stacac")   # STACAC species codes.
species(41, coding = "com")       # Commercial file prefix for Witch flounder.
species(126436, coding = "WoRMS") # WoRMS species codes.

# Converting between species codes:
species(10, output = "WoRMS") # DFO to WoRMS coding.
species(126436, coding = "worms", output = "code")
species(10, output = "stacac")
species(10, output = "stacac")
species(10, output = "nafo")
species(101, coding = "nafo", output = "stacac")

# Search for two key words:
species("cod atl")

# Search for two key words:
v <- species(c("cod atl", "witch", "wint fl"))
species(v) # Extract names.

# Species entries with the word "Atlantic" in their name:
species(species("atlantic"))

# Extract entire species tables:
species()
species.foreign()


TobieSurette/gulf.data documentation built on Jan. 19, 2025, 7:50 p.m.