env_grid_filter: Filter occurrences in environmental space

View source: R/env_grid_filter.R

env_grid_filterR Documentation

Filter occurrences in environmental space

Description

Filter the occurrence with the most realible species identification in the environmental space. This function is based in the function envSample provided by Varela et al. (2014) and were adapted to the naturaList package to select the occurrence with the most realible species identification in each environmental grid.

Usage

env_grid_filter(
  occ.cl,
  env.data,
  grid.res,
  institution.code = "institutionCode",
  collection.code = "collectionCode",
  catalog.number = "catalogNumber",
  year = "year",
  date.identified = "dateIdentified",
  species = "species",
  identified.by = "identifiedBy",
  decimal.latitude = "decimalLatitude",
  decimal.longitude = "decimalLongitude",
  basis.of.record = "basisOfRecord",
  media.type = "mediaType",
  occurrence.id = "occurrenceID"
)

Arguments

occ.cl

data frame with occurrence records information already classified by classify_occ function.

env.data

data frame with rows for occurrence observation and columns for each environmental variable

grid.res

numeric vector. Each value represents the width of each bin in the scale of the environmental variable. The order in this vector is assumed to be the same order in the of the variables in the env.data data frame.

institution.code

column name of occ.cl with the name (or acronym) in use by the institution having custody of the object(s) or information referred to in the record.

collection.code

column name of occ.cl with The name, acronym, code, or initials identifying the collection or data set from which the record was derived.

catalog.number

column name of occ.cl with an identifier (preferably unique) for the record within the data set or collection.

year

Column name of occ.cl the four-digit year in which the Event occurred, according to the Common Era Calendar.

date.identified

Column name of occ.cl with the date on which the subject was determined as representing the Taxon.

species

column name of occ with the species names.

identified.by

column name of occ.cl with the name of who determined the species.

decimal.latitude

column name of occ.cl latitude in decimal degrees.

decimal.longitude

column name of occ.cl longitude in decimal degrees.

basis.of.record

column name with the specific nature of the data record. See details.

media.type

column name of occ.cl with the media type of recording. See details.

occurrence.id

column name of occ with link or code for the occurrence record. See in Darwin Core Format

Value

Data frame with the same columns of occ.cl.

References

Varela et al. (2014). Environmental filters reduce the effects of sampling bias and improve predictions of ecological niche models. *Ecography*. 37(11) 1084-1091.

See Also

classify_occ

Examples


## Not run: 
library(naturaList)
library(tidyverse)

data("cyathea.br")
data("speciaLists")
data("r.temp.prec")

occ <- cyathea.br %>%
  filter(species == "Cyathea atrovirens")

occ.cl <- classify_occ(occ, speciaLists, spec.ambiguity = "is.spec")

# temperature and precipitaion data
env.data <- raster::extract(
  r.temp.prec,
  occ.cl[,c("decimalLongitude", "decimalLatitude")]
) %>% as.data.frame()

# the bins for temperature has 5 degrees each and for precipitation has 100 mm each
grid.res <- c(5, 100)

occ.filtered <- env_grid_filter(
  occ.cl,
  env.data,
  grid.res
)


## End(Not run)


naturaList documentation built on May 29, 2024, noon