Learn R Programming

rfishbase (version 0.2-2)

findSpecies: Returns the matching indices in the data given a list of species names

Description

Returns the matching indices in the data given a list of species names

Usage

findSpecies(species, fish.data = NULL, path = NULL)

Arguments

species
a list of species names as "Genus_species" or "Genus species"
fish.data
the fishbase database or a subset
path
to cached copy of fishbase (optional, defaults to copy in package).

Value

  • a logical vector of length(fish.data) indicating the matches, that can be used to subset the full database in calls to other functions.

Details

underscores are removed automatically. Later versions may check names

Examples

Run this code
## The distribution of maximum depth in Arctic fishes
data(fishbase)
data(labridtree)
myfish <- findSpecies(labridtree$tip.label, fish.data)
getDepth(fish.data[myfish])

Run the code above in your browser using DataLab