Description Usage Arguments Value Functions Examples
Create a Leaflet map with the results of an SDM analysis. This map can be explored interactively in the viewer, so its possible to have a better comprehension of the outcomes of your SDM.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | sdm_leaflet(
sdm,
mode = "bin",
pts = NULL,
pal = NULL,
layernames = NULL,
crs = "standard",
cluster = FALSE
)
## S4 method for signature 'Raster'
sdm_leaflet(
sdm,
mode = "bin",
pts = NULL,
pal = NULL,
layernames = NULL,
crs = "standard",
cluster = FALSE
)
## S4 method for signature 'data.frame'
sdm_leaflet(
sdm,
mode = "bin",
pts = NULL,
pal = NULL,
layernames = NULL,
crs = "standard",
cluster = FALSE
)
|
sdm |
The SDM/ENM result (or any other spatial analysis result). Can be either a data.frame (for a single SDM result) or in the Raster* format (multiple layers allowed). Binary maps should have just two values (0 for absence and 1 for presence). Difference maps ("quad" mode, see below) should have 4 values: 0 for unsuitable areas, 1 for areas that were lost, 2 for areas where there was gain of area and 3 for areas where suitability was mantained. Its easy to produce such a map from binary maps. Just multiply the future condition binary map by 2 and sum the current map. |
mode |
A character string indicating the mode of ploting. Should be one of "bin" (used for thresholded binary SDMs), "quad" (used for ploting difference maps between a binary reference map and a future one) or "continuous" (used for plotting continuous scale data). |
pts |
A data frame containing the presence or presence/absence points (optional). The first column should be longitude (x) and the sencond latitude (y). In the case of presence/absence data, an additional collumn should be provided, coded as 0 (absence) and 1 (presence). |
pal |
Character string indicating the name of the palette (see gen_pal). If not supplied, the default will be used. |
layernames |
An optional character vector indicating the names of the layers. This will be used in the legend. If not supplied, names will be extracted from the RasterLayer. |
crs |
Enables to change the default projection used in the Leaflet package. For now, not functional. |
cluster |
Should the points be clustered (i.e., aggregated)? Only valid if 'pts' is supplied. Default is FALSE. |
A Leaflet map.
sdm_leaflet,Raster-method
: Method for Raster*
sdm_leaflet,data.frame-method
: Method for data frames
1 2 3 4 5 6 7 8 9 10 11 12 | library(sdmvis)
# Load data
data("thresholded_sdm")
data("pa_data")
# Set names
sdm.names <- c("current", "future")
# Plot
sdm_leaflet(sdm = thresholded_sdm,
mode = "bin",
pts = pa_data,
layernames = sdm.names)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.