plotOutliers | R Documentation |
Spatial or environmental outliers
plotOutliers(
pres,
env = NULL,
outlierNames = c("spOutlier", "envOutlier"),
shpToPlot = NULL,
legLoc = "bottomleft"
)
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' |
env |
an optional raster object to be plotted |
outlierNames |
character vector indicating the name of the columns in ‘pres' to plot. e.g., c(’spOutlier','envOutlier') |
shpToPlot |
an optional spatialPolygons object to be plotted |
legLoc |
legend location, of the form 'bottomleft', 'topright', etc. |
See Examples.
nothing
Cory Merow <cory.merow@gmail.com>
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=findOutlyingPoints(pres=myPresDF,
spOutliers=TRUE,
envOutliers=TRUE,
pval=1e-5)
world.shp=readRDS(system.file('extdata/worldShpMollwide.rds',package='occOutliers'))
plotOutliers(presOut,shpToPlot = world.shp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.