BIEN_ranges_species {BIEN}R Documentation

Download range maps for given species.

Description

BIEN_ranges_species extracts range maps for the specified species.

Usage

BIEN_ranges_species(
  species,
  directory = NULL,
  matched = TRUE,
  match_names_only = FALSE,
  include.gid = FALSE,
  ...
)

Arguments

species

A single species or a vector of species.

directory

Directory that range maps should be saved in. If none is specified, range maps will be saved in the current working directory.

matched

Return a list of taxa that were downloaded. Default is TRUE.

match_names_only

Check for range maps for the taxa specified without downloading range maps. Default is FALSE.

include.gid

Should the files returned have a unique GID appended to them? This is needed if downloading multiple maps for the same species.

...

Additional arguments passed to internal functions.

Value

Range maps for specified species.

Note

Details on the construction of BIEN range maps is available at https://bien.nceas.ucsb.edu/bien/biendata/bien-3/

See Also

Other range functions: BIEN_ranges_box(), BIEN_ranges_genus(), BIEN_ranges_intersect_species(), BIEN_ranges_list(), BIEN_ranges_load_species(), BIEN_ranges_sf(), BIEN_ranges_shapefile_to_skinny(), BIEN_ranges_skinny_ranges_to_richness_raster(), BIEN_ranges_species_bulk()

Examples

## Not run: 
library(sf)
library(maps) #a convenient source of maps
species_vector <- c("Abies_lasiocarpa","Abies_amabilis")
BIEN_ranges_species(species_vector)
BIEN_ranges_species(species_vector, match_names_only = TRUE)
temp_dir <- file.path(tempdir(), "BIEN_temp")#Set a working directory
BIEN_ranges_species(species = species_vector,
                    directory = temp_dir)#saves ranges to a temporary directory
BIEN_ranges_species("Abies_lasiocarpa")
BIEN_ranges_species("Abies_lasiocarpa",
                    directory = temp_dir)

#Reading files

Abies_poly <- st_read(dsn = temp_dir,
                      layer = "Abies_lasiocarpa")

#Plotting files
plot(Abies_poly[1])#plots the range, but doesn't mean much without any reference
map('world', fill = TRUE, col = "grey")#plots a world map (WGS84 projection), in grey

plot(Abies_poly[1],
     col = "forest green",
     add = TRUE) #adds the range of Abies lasiocarpa to the map

# Getting data from the files (currently only species names and a BIEN ID field)
Abies_poly$species#gives the species name associated with "Abies_poly"
## End(Not run)#'

[Package BIEN version 1.2.6 Index]