Skip to content

Commit

Permalink
Minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
boyanangelov committed Sep 24, 2020
1 parent c92aa18 commit 568acb7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions interpretable_sdm.r
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ library(rsample)
library(latticeExtra)
library(sp)
library(ggplot2)
library(maptools)

# Get and prepare data ----------------------------------------------------
set.seed(42)
Expand Down Expand Up @@ -68,7 +69,7 @@ ale$plot() +

# Generate explanations ---------------------------------------------------
# resampling
sample_data <- withr::with_seed(1, sample_n(data_test_subset, 3))
sample_data <- withr::with_seed(10, sample_n(data_test_subset, 3))
sample_data_coords <- dplyr::select(sample_data, c("x", "y"))
sample_data$x <- NULL
sample_data$y <- NULL
Expand Down Expand Up @@ -103,8 +104,17 @@ pr <-


coordinates(sample_data_coords) <- ~ x + y

sl1 <- list("sp.points", sample_data_coords, pch=1, cex=1.2, lwd=2, col="white")
sl2 <- list("sp.pointLabel", sample_data_coords, label=c("Case 1","Case 2","Case 3"),
cex=0.9, col="white", fontface=2)

rf_map <-
spplot(pr, main = "Habitat Suitability Map",
scales = list(draw = TRUE),
sp.layout = list("sp.points", sample_data_coords, pch=1, cex=1.2, lwd=2, col="white"))
sp.layout = list(sl1,sl2),
labels=TRUE
)

rf_map

0 comments on commit 568acb7

Please sign in to comment.