plotPA: Plot Presence Absence Map

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotPA.R

Description

Plot a presence absence map using the given threshold.

Usage

1
2
3
4
5
6
7
8
9
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

plotPred.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 documentation built on July 17, 2021, 9:06 a.m.