Description Usage Arguments Value Author(s) Examples
Uses the leaflet
library to plot a raster file, and overlayed points if the point coordinates are provided. Alternatively, it accepts a grouping vector for the points (useful to, for example, plot the presences of different species at once).
plotVariable( variable, n = 100, opacity = 0.5, begin = 0, end = 1, direction = 1, option = "D", points.x = NULL, points.y = NULL, points.groups = NULL, points.legend = "Points" )
1 2 3 | plotVariable(variable, n = 100, opacity = 0.5, begin = 0, end = 1,
direction = 1, option = "D", points.x = NULL, points.y = NULL,
points.groups = NULL, points.legend = "Points", points.size = 10)
|
variable |
A raster object. It can be the subset of a brick, as in |
n |
Number of colors (integer higher than 1) to use in the color palette. Argument of the |
opacity |
Transparency in the range [0, 1]. If close to 1, the underlying political map will remain hidden. |
begin |
Numeric in the range [0, 1], color at which the color palette starts. |
end |
Numeric in the range [0, 1], color at which the color palette ends |
direction |
Order of the colors in the color palette. Use -1 to reverse the color palette. |
option |
A character string indicating the colormap option to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E"). |
points.x |
Numeric vector with longitude coordinates for a set of points. Must be in the same coordinate reference ystem as |
points.y |
Numeric vector with latitude coordinates for a set of points. Must be in the same coordinate reference ystem as |
points.groups |
Numeric or character vector to group sets of points together. Must have the same length as |
points.legend |
Quoted string with the title to be used in the point legend. |
points.size |
Numeric, size of the points. |
A leaflet plot.
Blas Benito <blasbenito@gmail.com>
1 2 3 4 5 6 7 8 9 10 | data(virtualSpecies)
data(europe2000)
plotVariable(
variable = europe2000[["bio1"]],
option = "B",
opacity = 0.7,
points.x = virtualSpecies$observed.presence$x,
points.y = virtualSpecies$observed.presence$y,
points.size = 5
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.