Description Usage Arguments Value Author(s) References Examples
View source: R/map_extrapolation.R
Produces interactive html maps of extrapolation values in the prediction area. The function relies on the leaflet
package (Cheng et al. 2018), and thus requires an internet connection (i.e. will not work offline).
1 2 3 4 5 6 7 8 |
map.type |
Character string. Type of map to be returned. Either |
extrapolation.object |
List object as returned by compute_extrapolation or compute_nearby. |
base.layer |
Base layer used for mapping. The default is |
sightings |
Species observations (optional). Can be supplied as a |
tracks |
Survey tracks (optional). Can be supplied as a |
verbose |
Logical. Show or hide possible warnings and messages. |
An interactive html map.
Phil J. Bouchet
Bouchet PJ, Miller DL, Roberts JJ, Mannocci L, Harris CM and Thomas L (2019). From here and now to there and then: Practical recommendations for extrapolating cetacean density surface models to novel conditions. CREEM Technical Report 2019-01, 59 p. https://research-repository.st-andrews.ac.uk/handle/10023/18509
Cheng J, Karambelkar B, Xie Y (2018). leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet' Library. R package version 2.0.2. https://CRAN.R-project.org/package=leaflet
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 32 33 | library(dsmextra)
# Load the Mid-Atlantic sperm whale data (see ?spermwhales)
data(spermwhales)
# Extract the data
segs <- spermwhales$segs
predgrid <- spermwhales$predgrid
# Define relevant coordinate system
my_crs <- sp::CRS("+proj=aea +lat_1=38 +lat_2=30 +lat_0=34 +lon_0=-73 +x_0=0
+y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0")
# Define covariates of interest
my_cov <- c("Depth", "DistToCAS", "SST", "EKE", "NPP")
# Assess extrapolation in the multivariate space defined by five covariates
spermw.extrapolation <- compute_extrapolation(samples = segs,
covariate.names = c("Depth", "DistToCAS", "SST", "EKE", "NPP"),
prediction.grid = predgrid,
coordinate.system = my_crs)
# Assess the percentage of data nearby
spermw.nearby <- compute_nearby(samples = segs,
prediction.grid = predgrid,
coordinate.system = my_crs,
covariate.names = my_cov,
nearby = 1)
# Generate maps
map_extrapolation(map.type = "extrapolation", extrapolation.object = spermw.extrapolation)
map_extrapolation(map.type = "mic", extrapolation.object = spermw.extrapolation)
map_extrapolation(map.type = "nearby", extrapolation.object = spermw.nearby)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.