mapBatch {monographaR} | R Documentation |
Generates map in batch mode
Description
This wrapper function will export maps for all species in data.
Usage
mapBatch(data, zoom = T, margin = 0.1, axes = T, shape = NULL,
export = "pdf", raster = NULL, RGB = NULL, points.col = "black",
points.border = "gray50", points.cex = 1, shape.col = "white",
shape.border = "black", raster.col = rev(gray.colors(65, start = 0, end = 1)),
raster.legend = F, hillshade = F, width = 8, height = 8,
image.resolution = 100, figure.number = T, title = T, box = T,
add.minimap = F, minimap.shape = NULL, minimap.shape.col = "white",
minimap.shape.border = "gray50", minimap.pos = "topleft",
minimap.add.points = T, minimap.points.col = "black",
minimap.points.border = "gray50", minimap.points.cex = 1,
minimap.extent = NULL, minimap.rect.fill = NA, minimap.rect.border = NULL,
maxpixels = 1e+05, ...)
Arguments
data |
data.frame |
zoom |
logical |
margin |
numeric |
axes |
logical |
shape |
a single or a list of spatial shape objects |
export |
"pdf", "jpeg" or "tiff" |
raster |
a raster object |
RGB |
a raster stack object (with three layers) |
points.col |
character |
points.border |
character |
points.cex |
numeric |
shape.col |
character |
shape.border |
character |
raster.col |
character (a vector of colors) |
raster.legend |
logical |
hillshade |
logical |
width |
numeric (in inches) |
height |
numeric (in inches) |
image.resolution |
numeric |
figure.number |
logical |
title |
logical |
box |
logical |
add.minimap |
logical |
minimap.shape |
a spatial shape object |
minimap.shape.col |
character (color) |
minimap.shape.border |
character (color) |
minimap.pos |
"topleft", "topright", "bottomleft" or "bottomright" |
minimap.add.points |
logical |
minimap.points.col |
character (color) |
minimap.points.border |
character (color) |
minimap.points.cex |
numeric |
minimap.extent |
numeric (x1, x2, y1, y2) |
minimap.rect.fill |
character (color) |
minimap.rect.border |
character (color) |
maxpixels |
numeric |
... |
additional arguments for plotting the extra shapes |
Details
The function has three output options: a single pdf with all maps (export =
"pdf") or individual image files for each species (export = "tiff" or "jpeg").
It requires a data.frame with three columns, ordered as: species, longitude
and latitude. If zoom = TRUE, the function will set the limits of the plot
using the distribution of each species plus the margin (relative value). If
zoom = FALSE, the function will use the distribution of the whole data to set
the limits (all maps will have the same limits). Colors can be changed with
the arguments points.col, shape.col, shape.border, while the size of the
points can be changed with points.cex. A raster layer can be provided
(elevation for instance), and the colors of the raster are controlled by
raster.col. The user can provide a single or a list of shape files,
otherwise the rnaturalearth
map is used.
Value
Exports a pdf or image files.
Author(s)
Marcelo Reginato
See Also
Examples
## loading the example data
data(monographaR_examples)
monographaR_examples$map_data -> data
head(data)
## running the function
# mapBatch(data , type="simple", zoom=T, margin=0.2, points.col="black",
# points.border="white", shape.col="gray90", points.cex=1.5, shape.border
# = "gray90", export="pdf")