Learn R Programming

SDMtune (version 0.1.0)

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.

See Also

plotPred

Examples

Run this code
# NOT RUN {
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
plotPA(map, th = 0.7, filename = "my_map", format = "ascii")
# }

Run the code above in your browser using DataLab