findEnvOutliers: Find outlying occurrence data in environmental space

View source: R/env.r

findEnvOutliersR Documentation

Find outlying occurrence data in environmental space

Description

Environmental outliers

Usage

findEnvOutliers(
  pres,
  pvalSet = 1e-05,
  method = "grubbs",
  checkPairs = TRUE,
  kRosner = NULL
)

Arguments

pres

a 'SpatialPoints' or 'SpatialPointsDataFrame' object describing the locations of species records. A 'SpatialPointsDataFrame' containing the values of environmental variables to be used must be supplied if 'envOutliers=TRUE'

pvalSet

user-specified p-value for assessing the significance of Grubbs test statistic.

method

character; options are 'iqr', 'grubbs', 'dixon', 'rosner'

checkPairs

logical; check for a single pair of outliers using the Grubbs test. This can only be performed for sample sizes <30. Only a single test is used because repeating it tends to throw out more points than seem reasonable, by eye. The value has no effect unless ‘method=’grubbs''.

kRosner

integer between 1 and 10. Determines the number of outliers suspected with a Rosner test. The value has no effect unless ‘method=’rosner''.# @keywords

Details

See Examples.

Value

Returns the indices of environmental outliers

Author(s)

Cory Merow <cory.merow@gmail.com>

Examples

myPres=read.csv(system.file('extdata/SpeciesCSVs/Camissonia_tanacetifolia.csv',
                            package='occOutliers'))
myPres=myPres[complete.cases(myPres),]
sp::coordinates(myPres)=c(1,2)
myEnv=raster::stack(system.file('extdata/AllEnv.tif',package='occOutliers'))
names(myEnv)=read.table(system.file('extdata/layerNames.csv',package='occOutliers'))[,1]
myPresDF=sp::SpatialPointsDataFrame(myPres,data.frame(raster::extract(myEnv,myPres)))
presOut=findEnvOutliers(pres=myPresDF,pvalSet=1e-5)

cmerow/occOutliers documentation built on July 8, 2023, 8:04 a.m.