plot.EnvironmentalOutlier: Exhibit suspicious outliers in an observation dataset.

plot.EnvironmentalOutlierR Documentation

Exhibit suspicious outliers in an observation dataset.

Description

Display observations and potential outliers diagnosed by function suspicious_env_outliers in a dataset.

Usage

## S3 method for class 'EnvironmentalOutlier'
plot(x, overlay_raster = NULL, pts_alpha = 0.5, ...)

Arguments

x

(EnvironmentalOutlier) The PAConversion object to plot. It could be the return of function suspicious_env_outliers.

overlay_raster

(RasterLayer or stars) The environmental raster to plot together with points.

pts_alpha

(numeric) The alpha used by geom_sf to show points.

...

Not used.

Value

A ggplot2 figure of outliers distribution among all observations.

See Also

suspicious_env_outliers, print.EnvironmentalOutlier

Examples


library(dplyr)
library(sf)
library(stars)
library(itsdm)

data("occ_virtual_species")
env_vars <- system.file(
  'extdata/bioclim_tanzania_10min.tif',
  package = 'itsdm') %>% read_stars() %>%
  slice('band', c(1, 5, 12, 16))

occ_outliers <- suspicious_env_outliers(
  occ = occ_virtual_species, variables = env_vars,
  z_outlier = 3.5, outliers_print = 4L)

plot(occ_outliers)
plot(occ_outliers,
  overlay_raster = env_vars %>% slice('band', 1))



itsdm documentation built on July 9, 2023, 6:45 p.m.