obis_match_habitat: Get OBIS occurences matched to layers of evironmental data

Description Usage Arguments Value Examples

View source: R/obis-to-h.R

Description

function to get OBIS records for a given species and match to IAP and Bio-Oracle temperatures if save_all_recs == TRUE, this full matched dataset will be saved before summarising function returns a summary of temperature affinity of the species

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
obis_match_habitat(
  sp_id,
  layers,
  fields = c("decimalLongitude", "decimalLatitude", "minimumDepthInMeters",
    "maximumDepthInMeters", "depth", "eventDate", "year", "month", "scientificName",
    "aphiaID"),
  check_match = FALSE,
  validate_sp_id = FALSE,
  geometry = NULL,
  ignore_failures = FALSE,
  overwrite = FALSE
)

Arguments

sp_id

validates species Aphia ID

layers

character vector of habitat layers to match

fields

fields to return from OBIS query. Defaults to c("decimalLongitude", "decimalLatitude","minimumDepthInMeters", "maximumDepthInMeters", "depth", "eventDate", "year", "month", "scientificName", "aphiaID")

check_match

whether to check validity of sp_id.

validate_sp_id

whether to check for validity of aphiaID on OBIS

geometry

an sf object. Queries will be faster if the geometry is simple and restricted in space.

ignore_failures

whether to through an error or return NULL for queries that return no obis records.

overwrite

whether to re-download and overwrite already downloaded layers

Value

an sf object, one row for each species occurence returned from obis. Column include requested OBIS metadata through fields argument plus a column for each layer environmental layer requested containing data retuned for each occurence location.

Examples

1
2
3
4
5
6
7
8
## Not run: 
obis_match_habitat(sp_id = 325567, layers = c(
  "BO_bathymean",
  "BO2_phosphateltmax_bdmean", "BO2_salinitymin_ss",
  "rock50cm", "april", "march"
))

## End(Not run)

EMODnet/OBIShmpr documentation built on Oct. 4, 2020, 12:12 a.m.