Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotPA

Plot Presence Absence Map


Description

Plot a presence absence map using the given threshold.

Usage

plotPA(
  map,
  th,
  colors = NULL,
  hr = FALSE,
  filename = NULL,
  format = "GTiff",
  ...
)

Arguments

map

raster object with the prediction.

th

numeric. The threshold used to convert the output in a presence/absence map.

colors

vector. Colors to be used, default is NULL and uses red and blue.

hr

logical, if TRUE produces an output with high resolution, default is FALSE.

filename

character, if provided the raster map is saved in a file, default is NULL.

format

character. The output format, see writeRaster for all the options, default is Geotiff.

...

Additional arguments, see writeRaster for all the options.

Value

A ggplot object.

Author(s)

Sergio Vignali

See Also

Examples

map <- raster::raster(matrix(runif(400, 0, 1), 20, 20))
plotPA(map, th = 0.8)
# Custom colors
plotPA(map, th = 0.5, colors = c("#d8b365", "#018571"))
# Save the file
## Not run: 
# The following command will save the map in the working directory
plotPA(map, th = 0.7, filename = "my_map", format = "ascii")

## End(Not run)

SDMtune

Species Distribution Model Selection

v1.1.4
GPL-3
Authors
Sergio Vignali [aut, cre] (<https://orcid.org/0000-0002-3390-5442>), Arnaud Barras [aut] (<https://orcid.org/0000-0003-0850-6965>), Veronika Braunisch [aut] (<https://orcid.org/0000-0001-7035-4662>), Conservation Biology - University of Bern [fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.