Skip to content

Commit

Permalink
Update to version 0.0.5 (#53)
Browse files Browse the repository at this point in the history
* Update CITATION.cff

* Update CITATION.cff

* Smaller bug fixes and name sanitations

* Update CITATION.cff

* Prelunch commit. Some smaller fixes to make writing and loading models work

* Update CITATION.cff

* Pre-party commit. Similarity still not working yet.

* Update CITATION.cff

* Several updates, most notably improved 5 parameter Richards curve for offset calculations

* Re-build README.md

* Attempt to fix ci-error in tests

* Small fix for tests

* another attempt for ci fix

---------

Co-authored-by: Martin-Jung <[email protected]>
  • Loading branch information
Martin-Jung and Martin-Jung authored Jun 25, 2023
1 parent 30411e0 commit 4ec59b4
Show file tree
Hide file tree
Showing 91 changed files with 13,923 additions and 12,391 deletions.
754 changes: 754 additions & 0 deletions CITATION.cff

Large diffs are not rendered by default.

290 changes: 146 additions & 144 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,144 +1,146 @@
Package: ibis.iSDM
Type: Package
Title: Modelling Framework for Integrated Biodiversity Distribution Scenarios
Version: 0.0.4
Authors@R:
c(person(given = "Martin",
family = "Jung",
role = c("aut", "cre", "cph"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-7569-1390")),
person(given = "Maximilian H.K.",
family = "Hesselbarth",
role = c("ctb"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-1125-9918"))
)
Maintainer: Martin Jung <[email protected]>
Description: Integrated framework of modelling the distribution of species and ecosystems in a suitability framing. This package allows the estimation of integrated species distribution models (iSDM) based on several sources of evidence and provided presence-only and presence-absence datasets. It makes heavy use of point-process models for estimating habitat suitability and allows to include spatial latent effects and priors in the estimation. To do so 'ibis.iSDM' supports a number of engines for Bayesian and more non-parametric machine learning estimation. Further, the 'ibis.iSDM' is specifically customized to support spatial-temporal projections of habitat suitability into the future.
Language: en-GB
License: CC BY 4.0
Encoding: UTF-8
Imports:
assertthat (>= 0.2.0),
doFuture (>= 0.12.2),
foreach,
future (>= 1.23.0),
dplyr,
geodist,
ggplot2,
graphics,
methods,
ncdf4,
parallel,
posterior,
proto (>= 1.0.0),
terra (>= 1.7-10),
sf (>= 0.9),
stars (>= 0.5),
stats,
tibble (>= 2.0.0),
uuid,
utils
Depends:
R(>= 4.1.0)
Suggests:
abind,
BoomSpikeSlab (>= 1.2.4),
covr,
inlabru,
glmnet,
glmnetUtils,
dbarts (>= 0.9-22),
deldir,
doParallel,
ellipsis,
igraph,
knitr,
mboost,
modEvA,
ncmeta,
progress,
rmarkdown,
rstan (>= 2.21.0),
rstantools (>= 2.1.1),
testthat,
xgboost
URL: https://iiasa.github.io/ibis.iSDM/
BugReports: https://github.com/iiasa/ibis.iSDM/issues
RoxygenNote: 7.2.3
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
Biarch: true
SystemRequirements: GNU make
VignetteBuilder: knitr
Collate:
'utils.R'
'bdproto.R'
'waiver.R'
'bdproto-biodiversitydataset.R'
'bdproto-biodiversitydistribution.R'
'add_biodiversity.R'
'bdproto-biodiversityscenario.R'
'add_constraint.R'
'add_constraint_MigClim.R'
'add_control_bias.R'
'add_latent.R'
'bdproto-log.R'
'add_log.R'
'add_offset.R'
'bdproto-predictors.R'
'add_predictors.R'
'add_predictors_globiom.R'
'identifier.R'
'bdproto-distributionmodel.R'
'bdproto-priorlist.R'
'bdproto-prior.R'
'add_priors.R'
'bdproto-engine.R'
'bdproto-settings.R'
'utils-spatial.R'
'data.R'
'distribution.R'
'effects.R'
'engine_bart.R'
'engine_breg.R'
'engine_gdb.R'
'engine_glmnet.R'
'utils-inla.R'
'engine_inla.R'
'engine_inlabru.R'
'engine_stan.R'
'engine_xgboost.R'
'ensemble.R'
'ibis.iSDM-package.R'
'misc.R'
'partial.R'
'plot.R'
'print.R'
'prior_bart.R'
'prior_breg.R'
'prior_gdb.R'
'prior_glmnet.R'
'prior_inla.R'
'prior_stan.R'
'prior_xgb.R'
'priors.R'
'project.R'
'pseudoabsence.R'
'scenario.R'
'similarity.R'
'summary.R'
'threshold.R'
'train.R'
'utils-bart.R'
'utils-breg.R'
'utils-gdb.R'
'utils-glmnet.R'
'utils-predictors.R'
'utils-scenario.R'
'utils-stan.R'
'utils-xgboost.R'
'validate.R'
'write_output.R'
'zzz.R'
Package: ibis.iSDM
Type: Package
Title: Modelling framework for integrated biodiversity distribution scenarios
Version: 0.0.5
Authors@R:
c(person(given = "Martin",
family = "Jung",
role = c("aut", "cre", "cph"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-7569-1390")),
person(given = "Maximilian H.K.",
family = "Hesselbarth",
role = c("ctb"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-1125-9918"))
)
Maintainer: Martin Jung <[email protected]>
Description: Integrated framework of modelling the distribution of species and ecosystems in a suitability framing. This package allows the estimation of integrated species distribution models (iSDM) based on several sources of evidence and provided presence-only and presence-absence datasets. It makes heavy use of point-process models for estimating habitat suitability and allows to include spatial latent effects and priors in the estimation. To do so 'ibis.iSDM' supports a number of engines for Bayesian and more non-parametric machine learning estimation. Further, the 'ibis.iSDM' is specifically customized to support spatial-temporal projections of habitat suitability into the future.
Language: en-GB
License: CC BY 4.0
Encoding: UTF-8
Imports:
assertthat (>= 0.2.0),
doFuture (>= 0.12.2),
foreach,
future (>= 1.23.0),
dplyr,
geodist,
ggplot2,
graphics,
methods,
ncdf4,
ncmeta,
parallel,
posterior,
proto (>= 1.0.0),
terra (>= 1.7-10),
sf (>= 0.9),
stars (>= 0.5),
stats,
tibble (>= 2.0.0),
uuid,
utils
Depends:
R(>= 4.1.0)
Suggests:
abind,
BoomSpikeSlab (>= 1.2.4),
covr,
inlabru (>= 2.6.0),
glmnet (>= 4.1),
glmnetUtils,
dbarts (>= 0.9-22),
deldir,
doParallel,
ellipsis,
igraph,
knitr,
mboost,
modEvA,
progress,
rmarkdown,
rstan (>= 2.21.0),
rstantools (>= 2.1.1),
gnlm,
testthat,
xgboost
URL: https://iiasa.github.io/ibis.iSDM/
BugReports: https://github.com/iiasa/ibis.iSDM/issues
RoxygenNote: 7.2.3
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
Biarch: true
SystemRequirements: GNU make
VignetteBuilder: knitr
Collate:
'utils.R'
'bdproto.R'
'waiver.R'
'bdproto-biodiversitydataset.R'
'bdproto-biodiversitydistribution.R'
'add_biodiversity.R'
'bdproto-biodiversityscenario.R'
'add_constraint.R'
'add_constraint_MigClim.R'
'add_control_bias.R'
'add_latent.R'
'bdproto-log.R'
'add_log.R'
'add_offset.R'
'bdproto-predictors.R'
'add_predictors.R'
'add_predictors_globiom.R'
'identifier.R'
'bdproto-distributionmodel.R'
'bdproto-priorlist.R'
'bdproto-prior.R'
'add_priors.R'
'bdproto-engine.R'
'bdproto-settings.R'
'utils-spatial.R'
'data.R'
'distribution.R'
'effects.R'
'engine_bart.R'
'engine_breg.R'
'engine_gdb.R'
'engine_glmnet.R'
'utils-inla.R'
'engine_inla.R'
'engine_inlabru.R'
'engine_stan.R'
'engine_xgboost.R'
'ensemble.R'
'ibis.iSDM-package.R'
'misc.R'
'partial.R'
'plot.R'
'print.R'
'prior_bart.R'
'prior_breg.R'
'prior_gdb.R'
'prior_glmnet.R'
'prior_inla.R'
'prior_stan.R'
'prior_xgb.R'
'priors.R'
'project.R'
'pseudoabsence.R'
'scenario.R'
'similarity.R'
'summary.R'
'threshold.R'
'train.R'
'utils-bart.R'
'utils-breg.R'
'utils-form.R'
'utils-gdb.R'
'utils-glmnet.R'
'utils-predictors.R'
'utils-scenario.R'
'utils-stan.R'
'utils-xgboost.R'
'validate.R'
'write_output.R'
'zzz.R'
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export(rm_offset)
export(rm_predictors)
export(rm_priors)
export(run_stan)
export(sanitize_names)
export(scenario)
export(sel_predictors)
export(similarity)
Expand Down Expand Up @@ -197,4 +198,5 @@ import(sf)
import(terra)
importFrom(foreach,"%do%")
importFrom(foreach,"%dopar%")
importFrom(methods,as)
importFrom(stats,effects)
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# ibis.iSDM 0.0.5

* Addition of 5 parameter logistic curve offsets with parameter search to `add_offset`.
* Further smaller documentation fixes towards a CRAN submission #38
* Bug with with `write_model`, now converting `terra` objects to `data.frames` between import/export.
* Smaller bug fixes, for example in `similarity`, addition of variable name sanitization to predictors by default.

# ibis.iSDM 0.0.4

* Smaller bug fixes with regards to writing outputs and adding pseudo-absences.
Expand Down
6 changes: 3 additions & 3 deletions R/add_constraint.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ NULL
#' give the number of iteration steps (or within year migration steps).
#' For adaptability constraints this parameter specifies the extent (in units of standard deviation) to which extrapolations
#' should be performed.
#' @param type A [`character`] indicating the type used in the method. See for instance [`kissmig::kissmig`].
#' @param type A [`character`] indicating the type used in the method. See for instance \code{`kissmig`}.
#' @param layer A [`SpatRaster`] object that can be used for boundary constraints (Default: \code{NULL}).
#' @param pext [`numeric`] indicator for [`kissmig`] of the probability a colonized cell becomes uncolonised,
#' @param pext [`numeric`] indicator for \code{`kissmig`} of the probability a colonized cell becomes uncolonised,
#' i.e., the species gets locally extinct (Default: \code{0.1}).
#' @param pcor [`numeric`] probability that corner cells are considered in the 3x3 neighbourhood (Default: \code{0.2}).
#' @param ... passed on parameters. See also the specific methods for adding constraints.
Expand All @@ -30,7 +30,7 @@ NULL
#' **Dispersal**:
#' * \code{sdd_fixed} - Applies a fixed uniform dispersal distance per modelling timestep.
#' * \code{sdd_nexpkernel} - Applies a dispersal distance using a negative exponential kernel from its origin.
#' * \code{kissmig} - Applies the kissmig stochastic dispersal model. Requires [`kissmig`] package. Applied at each modelling time step.
#' * \code{kissmig} - Applies the kissmig stochastic dispersal model. Requires \code{`kissmig`} package. Applied at each modelling time step.
#' * \code{migclim} - Applies the dispersal algorithm MigClim to the modelled objects. Requires [`MigClim`] package.
#'
#' A comprehensive overview of the benefits of including dispersal constrains in species distribution models
Expand Down
3 changes: 2 additions & 1 deletion R/add_constraint_MigClim.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ NULL
#' \dontrun{
#' # Assumes that a trained 'model' object exists
#' mod <- scenario(model) |>
#' add_predictors(env = predictors, transform = 'scale', derivates = "none") |>
#' add_predictors(env = predictors, transform = 'scale',
#' derivates = "none") |>
#' add_constraint_MigClim() |>
#' project()
#' }
Expand Down
10 changes: 6 additions & 4 deletions R/add_control_bias.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#' to the target value during projection. By default the value is set to the minimum value found in the layer (Default: \code{NULL}).
#' @param add [`logical`] specifying whether a new offset is to be added. Setting
#' this parameter to \code{FALSE} replaces the current offsets with the new one (Default: \code{TRUE}).
#' @param ... Other parameters or arguments (currently not supported).
#' @references
#' * Warton, D.I., Renner, I.W. and Ramp, D., 2013. Model-based control of observer bias for the analysis of presence-only data in ecology. PloS one, 8(11), p.e79168.
#' * Merow, C., Allen, J.M., Aiello-Lammens, M., Silander, J.A., 2016. Improving niche and range estimates with Maxent and point process models by integrating spatially explicit information. Glob. Ecol. Biogeogr. 25, 1022–1036. https://doi.org/10.1111/geb.12453
Expand Down Expand Up @@ -75,15 +74,18 @@ methods::setMethod(
}

# Calculate a default bias value if not already set
if(is.null(bias_value)) bias_value <- terra::global(layer, stat = "min", na.rm = TRUE)
if(is.null(bias_value)) bias_value <- terra::global(layer, stat = "min", na.rm = TRUE)[,1]

# Check for infinite values
assertthat::assert_that(
terra::nlyr(layer) == length(bias_value),
all( terra::global(layer, "range", na.rm = TRUE) > 0),
msg = "Infinite values found in the layer (maybe log of 0?)."
all( terra::global(layer, "max", na.rm = TRUE)[,1] > 0),
msg = "Infinite values found in the bias layer (maybe log of 0?)."
)

# Sanitize names if specified
if(getOption('ibis.cleannames')) names(layer) <- sanitize_names(names(layer))

# Now precede depending on method
if(method == "partial"){
if(getOption('ibis.setupmessages')) myLog('[Setup]','green','Adding bias controlled variable...')
Expand Down
Loading

0 comments on commit 4ec59b4

Please sign in to comment.