This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(mapview) | |
library(raster) | |
library(dplyr) | |
library(biomod2) | |
poppendorf_df <- as.data.frame(poppendorf, xy = TRUE) | |
poppendorf_df$coords_all <- paste(poppendorf_df$x, poppendorf_df$y, sep = "_") | |
poppendorf_pts <- sampleRandom(poppendorf, 1000, sp = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... cont'd | |
#### Backcasting part #### | |
tic("Formating model data") | |
cat("Formating data for backcasting...", "\n") | |
model_data <- BIOMOD_FormatingData(resp.var = presabs[, "PA"], expl.var = rasters_region_stack, | |
eval.resp.var = presabs_eval[, "PA"], | |
eval.resp.xy = presabs_eval[, c("x", "y")], | |
resp.xy = presabs[, c("x", "y")], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Elevation lines map for the #30DayMapChallenge | |
# Author: Mirza Čengić | [email protected] | |
pacman::p_load(Rahat, tidyverse, raster, topo.ridges) | |
raster_bih <- getData(name = "alt", country = "BA") | |
raster_bih_agg <- aggregate(raster_bih, fact = 5) | |
raster_bih_agg[is.na(raster_bih_agg)] <- 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat("BIOMOD_EnsembleModeling2 loaded", "\n") | |
BIOMOD_EnsembleModeling2 <- function (modeling.output, chosen.models = "all", em.by = "PA_dataset+repet", | |
eval.metric = "all", eval.metric.quality.threshold = NULL, | |
models.eval.meth = c("KAPPA", "TSS", "ROC"), prob.mean = TRUE, | |
prob.cv = FALSE, prob.ci = FALSE, prob.ci.alpha = 0.05, prob.median = FALSE, | |
committee.averaging = FALSE, prob.mean.weight = FALSE, prob.mean.weight.decay = "proportional", | |
VarImport = 0) | |
{ | |
biomod2:::.bmCat("Build Ensemble Models") | |
args <- biomod2:::.BIOMOD_EnsembleModeling.check.args(modeling.output, |