plot_sdm_map: Plot SDM map

Description Usage Arguments Value Examples

View source: R/plot_sdm_map.r

Description

Plot SDM map

Usage

1
2
plot_sdm_map(raster_data, bmr_models, model_id, model_iteration,
  map_type = "static")

Arguments

raster_data

A raster dataset containing the occurrence data.

bmr_models

A list of models extracted from the benchmarking bmr object.

model_id

A character string indicating the model id of interest.

model_iteration

A numeric value indicating the model iteration of interest.

map_type

A logical indicating if the map should be static or interactive.

Value

An interactive leaflet map, showing the species distribution.

Examples

 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
## Not run: 
# download benchmarking data
benchmarking_data <- get_benchmarking_data("Lynx lynx",
                                           limit = 1500,
                                           climate_resolution = 10)

# create a list of algorithms to compare
learners <- list(mlr::makeLearner("classif.randomForest",
                                  predict.type = "prob"),
                 mlr::makeLearner("classif.logreg",
                                  predict.type = "prob"))

# run the model benchmarking process
bmr <- benchmark_sdm(benchmarking_data$df_data,
                     learners = learners,
                     dataset_type = "default",
                     sample = FALSE)

# get best model results
# you should obtain a dataframe containing the highest performing (by AUC)
# algorithm name, iteration and associated AUC
best_results <- get_best_model_results(bmr)

# plot the SDM map of the best performing model
# change the map_type argument if you want a dynamic leaflet map
plot_sdm_map(raster_data = benchmarking_data$raster_data$climate_variables,
             bmr_models = bmr$learners,
             model_id = best_results$learner.id[1],
             model_iteration = best_results$iter[1],
             map_type = "static")

## End(Not run)

boyanangelov/sdmbench documentation built on July 9, 2019, 12:01 p.m.