Plot a presence absence map using the given threshold.
plotPA(map, th, colors = NULL, hr = FALSE, filename = NULL,
format = "GTiff", ...)
raster
object with the prediction.
numeric. The threshold used to convert the output in a presence/absence map.
vector. Colors to be used, default is NULL
and uses red
and blue.
logical, if TRUE
produces an output with high resolution,
default is FALSE.
character, if provided the raster map is saved in a file,
default is NULL
.
character. The output format, see
writeRaster
for all the options, default is Geotiff.
Additional arguments, see writeRaster
for all the
options.
A ggplot
object.
# 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