get_species_path: Get the data package path for a given species

Description Usage Arguments Value Examples

View source: R/ebirdst-loading.R

Description

This helper function can be used to get the path to a data package for a given species to be used by the various loading functions.

Usage

1
get_species_path(species, path = rappdirs::user_data_dir("ebirdst"))

Arguments

species

character; a single species given as a scientific name, common name or six-letter species code (e.g. woothr). The full list of valid species is can be viewed in the ebirdst_runs data frame included in this package. To return the path to the example data, use "example_data".

path

character; directory that the data were downloaded to. Defaults to the suggested persistent data directory data directory: rappdirs::user_data_dir("ebirdst")).

Value

The path to the data package directory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# download the example data
ebirdst_download("example_data")

# get the path
sp_path <- get_species_path("example_data")

# use it to load data
abd <- load_raster("abundance", sp_path)

# get the path to the full data package for yellow-bellied sapsucker
# common name, scientific name, or species code can be used
get_species_path("Yellow-bellied Sapsucker")
get_species_path("Sphyrapicus varius")
get_species_path("yebsap")

## End(Not run)

ebirdst documentation built on Jan. 16, 2021, 5:16 p.m.