Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
60fb4e7
fix: Resolve warnings by correcting Rmd image paths
danflop Nov 2, 2025
e277dd8
Fix: Enable running models with categorical variables when using ENMe…
danflop Dec 16, 2025
caecadc
Fix issue when trying to xfer to new area or time when using BIOCLIM …
danflop Jan 15, 2026
eba28c9
Fix loading error for multiple species selected in EnvSpace
danflop Jan 20, 2026
7b8fc07
Merge pull request #457 from danflop/fix/image-paths
danflop Jan 21, 2026
d72e1aa
Merge pull request #459 from danflop/fix/bioclim-xfer-area
danflop Jan 21, 2026
f5cf107
Add test case for categorical variables in MaxEnt
danflop Jan 22, 2026
056fb05
Merge pull request #460 from danflop/fix/envspace-occs
danflop Jan 22, 2026
45df4ea
Merge pull request #461 from danflop/fix/categorical-vars
danflop Jan 22, 2026
d288568
Integrate leaflet.extras draw bindings (archived on CRAN)
danflop Mar 11, 2026
ae63de3
Set Namespace with new draw functions and update documentation
danflop Mar 13, 2026
4445879
Adjust the draw toolbar removal logic
danflop Mar 13, 2026
6abc3e0
Prevent toolbar from disappearing when moving to different modules
danflop Mar 20, 2026
808d7bc
raster to stack (#462)
bjohnso005 Apr 23, 2026
96669b8
Fix links and added new code documentation
danflop Apr 28, 2026
7a039c3
Merge pull request #463 from danflop/feature/replace-leafletextras
danflop Apr 28, 2026
71034a0
Release prep: version 2.2.1
danflop Apr 29, 2026
a3522c0
Update version number to 2.2.1
danflop Apr 29, 2026
92e152d
Fix power-off icon visibility on macOS
danflop Apr 30, 2026
003e78d
CRAN checks for version 2.2.1
danflop May 5, 2026
ecce2cb
Fix Maxent compatibility issue with terra v1.9.11
danflop May 5, 2026
7cdd97c
Fix minor typo
danflop May 7, 2026
4bcc667
Merge pull request #464 from danflop/release/2.2.1
danflop May 7, 2026
b722ef2
Merge pull request #465 from wallaceEcoMod/dev
danflop May 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
^.*\.Rproj$ # Automatically added by RStudio,
^\.Rproj\.user$ # used for temporary files.
^README\.Rmd$ # An Rmarkdown file used to generate README.md
^cran-comments\.md$ # Comments for CRAN submission
^NEWS\.md$ # A news file written in Markdown
^cran-comments\.md$ # Comments for CRAN submissionS
\.DS_Store$ # for macs
cmip5* # worldclim files
^wallace.Rproj
Expand All @@ -13,3 +12,4 @@ cmip5* # worldclim files
^docs$
^pkgdown$
^LICENSE$
^CRAN-SUBMISSION$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cmip5
# r proj files
.Rproj.user
.RData
.Rproj
# .rmd files
temp*
#
Expand Down
17 changes: 8 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: wallace
Version: 2.2.0
Date: 2025-03-06
Version: 2.2.1
Date: 2026-05-05
Title: A Modular Platform for Reproducible Modeling of Species Niches
and Distributions
Description: The 'shiny' application Wallace is a modular platform for
Expand All @@ -12,8 +12,8 @@ Description: The 'shiny' application Wallace is a modular platform for
most package functionality can be found on the package's GitHub Pages
website: <https://wallaceecomod.github.io/wallace/articles/tutorial-v2.html>.
Authors@R:
c(person("Bethany A.", "Johnson", email = "bjohnso005@citymail.cuny.edu", role = "aut"),
person("Daniel F.", "Lopez-Lozano", email = "dlopezlozano@amnh.org", role = "aut"),
c(person("Daniel F.", "Lopez-Lozano", email = "dlopezlozano@amnh.org", role = "aut"),
person("Bethany A.", "Johnson", email = "bjohnso005@citymail.cuny.edu", role = "aut"),
person("Jamie M.", "Kass", email = "jamie.m.kass@gmail.com", role = "aut"),
person("Gonzalo E.", "Pinilla-Buitrago", email = "gepinillab@gmail.com", role = "aut"),
person("Andrea", "Paz", email = "paz.andreita@gmail.com", role = "aut"),
Expand Down Expand Up @@ -41,12 +41,11 @@ Imports:
ecospat (>= 4.0.0),
ENMeval (>= 2.0.5),
geodata,
htmltools,
knitcitations,
leafem,
leaflet.extras (>= 1.0.0),
magrittr,
markdown,
methods,
RColorBrewer,
rJava,
rlang,
Expand All @@ -73,10 +72,10 @@ Suggests:
raster,
rgbif (>= 3.3.0),
sp,
terra,
terra (>= 1.9-11),
testthat,
tools
License: GPL-3
URL: http://wallaceecomod.github.io/wallace/,
URL: https://wallaceecomod.github.io/wallace/
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.3
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by roxygen2: do not edit by hand

export(addDrawToolbar)
export(clearAll)
export(create_module)
export(ecoClimate_getdata)
export(ecoClimate_select)
export(ecospat.plot.nicheDEV)
export(editToolbarOptions)
export(envs_ecoClimate)
export(envs_userEnvs)
export(envs_worldclim)
Expand Down Expand Up @@ -34,6 +36,7 @@ export(predictMaxnet)
export(printVecAsis)
export(register_module)
export(remEnvsValsNA)
export(removeDrawToolbar)
export(reverseLabel)
export(run_wallace)
export(smartProgress)
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
wallace 2.2.1
=============
- Fixed image paths in the Team section.
- Enabled support for models with categorical variables when using ENMeval > 2.0.5.
- Fixed an issue occurring during model transfer to new areas or time periods when using BIOCLIM or Maxent.jar.
- Fixed a loading error triggered by selecting multiple species in Environmental Space.
- Integrated the drawing functionality of leaflet.extras directly into wallace to streamline dependencies.
- Fixed an issue with session code generation when visualizing map predictions and transferring to a new time period.
- Fixed UI rendering issue where the power-off icon was hidden on macOS.
- Fixed an issue affecting Maxent models when using terra > '1.9.11'.

wallace 2.2.0
=============
- updated for ENMeval v2.0.5 functionality
Expand Down
1 change: 0 additions & 1 deletion R/helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ spurious <- function(x) {
DT::renderDataTable(x)
RColorBrewer::brewer.pal(x)
leafem::addMouseCoordinates(x)
leaflet.extras::removeDrawToolbar(x)
markdown::html_format()
rmarkdown::github_document(x)
shinyWidgets::pickerInput(x)
Expand Down
8 changes: 4 additions & 4 deletions R/model_bioclim.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#' @param bg coordinates of background points to be used for modeling.
#' @param user.grp a list of two vectors containing group assignments for
#' occurrences (occs.grp) and background points (bg.grp).
#' @param bgMsk a RasterStack or a RasterBrick of environmental layers cropped
#' and masked to match the provided background extent.
#' @param bgMsk a SpatRaster of environmental layers cropped and masked to
#' match the provided background extent.
#' @param logger Stores all notification messages to be displayed in the Log
#' Window of Wallace GUI. Insert the logger reactive list here for running
#' in shiny, otherwise leave the default NULL.
Expand All @@ -55,7 +55,7 @@
#' bg <- read.csv(system.file("extdata/Bassaricyon_alleni_bgPoints.csv",
#' package = "wallace"))
#' partblock <- part_partitionOccs(occs, bg, method = 'block')
#' m <- model_bioclim(occs, bg, partblock, envs)
#' m <- model_bioclim(occs, bg, partblock, terra::rast(envs))
#' }
#'
#' @return Function returns an ENMevaluate object with all the evaluated models
Expand All @@ -80,7 +80,7 @@ model_bioclim <- function(occs, bg, user.grp, bgMsk, logger = NULL,
smartProgress(logger,
message = paste0("Building/Evaluating BIOCLIM model for ",
spName(spN), "..."), {
e <- ENMeval::ENMevaluate(occs = occs.xy, envs = terra::rast(bgMsk), bg = bg.xy,
e <- ENMeval::ENMevaluate(occs = occs.xy, envs = bgMsk, bg = bg.xy,
algorithm = "bioclim", partitions = "user",
user.grp = user.grp)
})
Expand Down
21 changes: 16 additions & 5 deletions R/model_maxent.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#' @param bg coordinates of background points to be used for modeling.
#' @param user.grp a list of two vectors containing group assignments for
#' occurrences (occs.grp) and background points (bg.grp).
#' @param bgMsk a RasterStack or a RasterBrick of environmental layers cropped
#' and masked to match the provided background extent.
#' @param bgMsk a SpatRaster of environmental layers cropped and masked to
#' match the provided background extent.
#' @param rms vector of range of regularization multipliers to be used in the
#' ENMeval run.
#' @param rmsStep step to be used when defining regularization multipliers to
Expand Down Expand Up @@ -76,7 +76,7 @@
#' rmsStep <- 1
#' fcs <- c('L', 'LQ')
#' m <- model_maxent(occs = occs, bg = bg, user.grp = partblock,
#' bgMsk = envs, rms = rms, rmsStep, fcs,
#' bgMsk = terra::rast(envs), rms = rms, rmsStep, fcs,
#' clampSel = TRUE, algMaxent = "maxnet",
#' parallel = FALSE)
#' }
Expand All @@ -86,6 +86,7 @@
#' @author Jamie M. Kass <jamie.m.kass@@gmail.com>
#' @author Gonzalo E. Pinilla-Buitrago <gepinillab@@gmail.com>
#' @author Bethany A. Johnson <bjohnso005@@citymail.cuny.edu>
#' @author Daniel Lopez-Lozano <dlopezlozano@@amnh.org.co>
# @note

#' @seealso \code{\link[ENMeval]{ENMevaluate}}
Expand Down Expand Up @@ -192,12 +193,18 @@ model_maxent <- function(occs, bg, user.grp, bgMsk, rms, rmsStep, fcs,
# get just coordinates
occs.xy <- occs %>% dplyr::select("longitude", "latitude")
bg.xy <- bg %>% dplyr::select("longitude", "latitude")

# convert the categorical variables to factors
if (!is.null(catEnvs)) {
bgMsk[[catEnvs]] <- terra::as.factor(bgMsk[[catEnvs]])
}

# run ENMeval
e <- ENMeval::ENMevaluate(occs = as.data.frame(occs.xy),
bg = as.data.frame(bg.xy),
partitions = 'user',
user.grp = user.grp,
envs = terra::rast(bgMsk),
envs = bgMsk,
tune.args = tune.args,
doClamp = clampSel,
algorithm = algMaxent,
Expand All @@ -219,7 +226,11 @@ model_maxent <- function(occs, bg, user.grp, bgMsk, rms, rmsStep, fcs,
updateProgress = updateProgress,
quiet = FALSE)

occPredVals <- raster::extract(e@predictions, occs.xy)
# Make sure e@predictions has an assigned CRS
if(terra::crs(e@predictions) == ""){
terra::crs(e@predictions) <- terra::crs(bgMsk)
}
occPredVals <- terra::extract(e@predictions, occs.xy)

endTxt <- paste("]), using", algMaxent, "with clamping",
ifelse(clampSel, "on.", "off."))
Expand Down
18 changes: 9 additions & 9 deletions R/penvs_bgMask.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#' environmental layers to be used in the modeling are cropped and masked
#' to the provided background area. The background area is determined in
#' the function penvs_bgExtent from the same component. The function returns
#' the provided environmental layers cropped and masked in the provided
#' format (either a rasterBrick or a rasterStack).
#' the provided environmental layers cropped and masked in the SpatRaster
#' format.
#'
#' @param occs data frame of cleaned or processed occurrences obtained from
#' components occs: Obtain occurrence data or, poccs: Process occurrence data.
Expand All @@ -59,10 +59,11 @@
#' bgMask <- penvs_bgMask(occs, envs, bgExt)
#' }
#'
#' @return A RasterStack or a RasterBrick of environmental layers cropped and
#' @return A SpatRaster of environmental layers cropped and
#' masked to match the provided background extent.
#' @author Jamie Kass <jamie.m.kass@@gmail.com>
#' @author Gonzalo E. Pinilla-Buitrago <gepinillab@@gmail.com>
#' @author Daniel Lopez-Lozano <dlopezlozano@@amnh.org.co>
#' @seealso \code{\link{penvs_userBgExtent}},
#' \code{\link{penvs_drawBgExtent}}, \code{\link{penvs_bgExtent}},
#' \code{\link{penvs_bgSample}}
Expand All @@ -81,18 +82,17 @@ penvs_bgMask <- function(occs, envs, bgExt, logger = NULL, spN = NULL) {
message = paste0("Masking rasters for ",
spName(spN), "..."), {

bgCrop <- raster::crop(envs, bgExt)
bgMask <- raster::mask(bgCrop, bgExt)
envs <- terra::rast(envs)
bgCrop <- terra::crop(envs, bgExt)
bgMask <- terra::mask(bgCrop, terra::vect(bgExt))
# GEPB: Workaround when raster alignment is changed after crop, which makes appears
# new duplicated occs in the same grid cells.
occsEnvsVals <- as.data.frame(raster::extract(bgMask,
occsEnvsVals <- as.data.frame(terra::extract(bgMask,
occs[, c('longitude', 'latitude')],
cellnumbers = TRUE))
occs.dups <- duplicated(occsEnvsVals[, 1])
if (sum(occs.dups) > 0) {
bgMask <- terra::project(terra::rast(bgMask),
terra::rast(envs), method = 'near')
bgMask <- methods::as(bgMask, "Raster")
bgMask <- terra::project(bgMask, envs, method = 'near')
}
})

Expand Down
2 changes: 1 addition & 1 deletion R/penvs_bgSample.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#' doBrick = TRUE)
#' bgExt <- penvs_bgExtent(occs, bgSel = 'bounding box', bgBuf = 0.5)
#' bgMask <- penvs_bgMask(occs, envs, bgExt)
#' bgsample <- penvs_bgSample(occs, bgMask, bgPtsNum = 1000)
#' bgsample <- penvs_bgSample(occs, raster::stack(bgMask), bgPtsNum = 1000)
#' }
#'
#' @return a dataframe containing point coordinates (longitude and latitude).
Expand Down
Loading
Loading