map_extrapolation.Rd
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).
map_extrapolation( map.type = NULL, extrapolation.object = NULL, base.layer = "ocean", sightings = NULL, tracks = NULL, verbose = TRUE )
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.
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
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)#> Warning: map_extrapolation relies on the leaflet package, which is built around a Web Mercator projection (EPSG:3857), and therefore requires rasters to be reprojected for plotting. As a result, minor discrepancies may occur between the interactive maps shown in the viewer, and the underlying raw data. The latter can be accessed directly from extrapolation object returned by <compute_extrapolation> and visualised using alternative packages such as ggplot2.map_extrapolation(map.type = "mic", extrapolation.object = spermw.extrapolation)#> Warning: map_extrapolation relies on the leaflet package, which is built around a Web Mercator projection (EPSG:3857), and therefore requires rasters to be reprojected for plotting. As a result, minor discrepancies may occur between the interactive maps shown in the viewer, and the underlying raw data. The latter can be accessed directly from extrapolation object returned by <compute_extrapolation> and visualised using alternative packages such as ggplot2.map_extrapolation(map.type = "nearby", extrapolation.object = spermw.nearby)#> Warning: map_extrapolation relies on the leaflet package, which is built around a Web Mercator projection (EPSG:3857), and therefore requires rasters to be reprojected for plotting. As a result, minor discrepancies may occur between the interactive maps shown in the viewer, and the underlying raw data. The latter can be accessed directly from extrapolation object returned by <compute_extrapolation> and visualised using alternative packages such as ggplot2.