Skip to content

Commit

Permalink
Small update to fix documentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Jung committed Mar 11, 2023
1 parent 1e8d9ef commit cb1ca02
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .covrignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
R/print.R
R/plot.R
R/data.R
R/zzz.R
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ibis.iSDM
Type: Package
Title: Modelling Framework for Integrated Biodiversity Distribution Scenarios
Version: 0.0.1
Version: 0.0.2
Authors@R:
c(person(given = "Martin",
family = "Jung",
Expand Down
31 changes: 16 additions & 15 deletions R/add_constraint.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ 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 [`kissmig::kissmig`].
#' @param layer A [`Raster`] 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,
#' 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.
#'
#' @seealso [`add_constraint_dispersal`], [`add_constraint_connectivity`], [`add_constraint_adaptability`],[`add_constraint_boundary`]
#' @seealso [`add_constraint_dispersal`], [`add_constraint_connectivity`], [`add_constraint_adaptability`], [`add_constraint_boundary`]
#' @details
#' Constraints can be added to scenario objects to increase or decrease the suitability of a given area for the
#' target feature. This function acts as a wrapper to add these constraints.
#' Currently supported are the following options:
#' **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{migclim} - Applies the dispersal algorithm MigClim to the modelled objects. Requires [MigClim] package.
#' * \code{kissmig} - Applies the kissmig stochastic dispersal model. Requires [`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
#' can be found in Bateman et al. (2013).
Expand Down Expand Up @@ -122,7 +122,7 @@ methods::setMethod(
# ------------------------ #
#### Dispersal constraints ####

#' @title Adds a dispersal constrain to a scenario object
#' @title Adds a dispersal constrain to a scenario object.
#' @name add_constraint_dispersal
#' @aliases add_constraint_dispersal
#' @inheritParams add_constraint
Expand Down Expand Up @@ -224,10 +224,10 @@ methods::setMethod(
)

#' Short-distance fixed dispersal function
#' @param baseline_threshold The [`RasterLayer`] with presence/absence information from a previous year
#' @param new_suit A new [`RasterLayer`] object
#' @param value A [`numeric`] value of the fixed dispersal threshold. In unit 'meters'.
#' @param resistance A resistance [`RasterLayer`] object with values to be omitted during distance calculation (Default: NULL)
#' @param baseline_threshold The [`RasterLayer`] with presence/absence information from a previous year.
#' @param new_suit A new [`RasterLayer`] object.
#' @param value A [`numeric`] value of the fixed dispersal threshold. In unit \code{'meters'}.
#' @param resistance A resistance [`RasterLayer`] object with values to be omitted during distance calculation (Default: \code{NULL}).
#' @noRd
#' @keywords internal
.sdd_fixed <- function(baseline_threshold, new_suit, value, resistance = NULL){
Expand Down Expand Up @@ -261,10 +261,10 @@ methods::setMethod(

#' Short-distance negative exponential kernel dispersal function
#' @param baseline_threshold The [`RasterLayer`] with presence/absence information from a previous year
#' @param new_suit A new [`RasterLayer`] object
#' @param value A [`numeric`] value of the fixed dispersal threshold. In unit 'meters'.
#' @param normalize Should a normalising constant be used for the exponential dispersal parameter. (Default: FALSE)
#' @param resistance A resistance [`RasterLayer`] object with values to be omitted during distance calculation (Default: NULL)
#' @param new_suit A new [`RasterLayer`] object.
#' @param value A [`numeric`] value of the fixed dispersal threshold. In unit \code{'meters'}.
#' @param normalize Should a normalising constant be used for the exponential dispersal parameter (Default: \code{FALSE}).
#' @param resistance A resistance [`RasterLayer`] object with values to be omitted during distance calculation (Default: \code{NULL}).
#' @noRd
#' @keywords internal
.sdd_nexpkernel <- function(baseline_threshold, new_suit, value, normalize = FALSE, resistance = NULL){
Expand Down Expand Up @@ -306,7 +306,7 @@ methods::setMethod(
#' @param baseline_threshold The [`RasterLayer`] with presence/absence information from a previous year.
#' @param new_suit A new [`RasterLayer`] object.
#' @param params A [vector] or [list] with passed on parameter values.
#' @param resistance A resistance [`RasterLayer`] object with values to be omitted during distance calculation (Default: NULL).
#' @param resistance A resistance [`RasterLayer`] object with values to be omitted during distance calculation (Default: \code{NULL}).
#' @noRd
#' @keywords internal
.kissmig_dispersal <- function(baseline_threshold, new_suit, params, resistance = NULL){
Expand Down Expand Up @@ -354,7 +354,8 @@ methods::setMethod(
#' @name add_constraint_connectivity
#' @aliases add_constraint_connectivity
#' @inheritParams add_constraint
#' @param resistance A [`RasterLayer`] object describing a resistance surface or barrier for use in connectivity constrains (Default: \code{NULL}).
#' @param resistance A [`RasterLayer`] object describing a resistance surface or barrier for use in
#' connectivity constrains (Default: \code{NULL}).
#' @family constraint
#' @keywords scenario
#' @exportMethod add_constraint_connectivity
Expand Down
1 change: 1 addition & 0 deletions R/bdproto-prior.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NULL
#' inherited by any specific prior.
#'
#' @name Prior-class
#' @return Defines a Prior object
#' @aliases Prior
#' @family bdproto
#' @keywords bdproto
Expand Down
6 changes: 4 additions & 2 deletions R/bdproto-priorlist.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ NULL
#' It provides methods for accessing, adding and removing priors from the list
#'
#' @name PriorList-class
#' @examples{
#' priors(
#' @examples
#' \dontrun{
#' priors(
#' INLAPrior('var1','normal',c(0,0.1)),
#' INLAPrior('var2','normal',c(0,0.1))
#' )
#' }
#' @return A PriorList object.
#' @aliases PriorList
#' @family bdproto
#' @keywords bdproto
Expand Down
3 changes: 2 additions & 1 deletion R/bdproto.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NULL
#' @param ... A list of members to add to the new `bdproto` object.
#' @source https://ggplot2.tidyverse.org/reference/ggproto.html#examples
#' @note
#' All [bdproto] objects have several functions that allow to access data and
#' All [`bdproto`] objects have several functions that allow to access data and
#' summarize information within them. Run \code{names(object)} to show the
#' available functions.
#' @examples
Expand All @@ -39,6 +39,7 @@ NULL
#' Abacus$add(10)
#' Abacus$subtract(10)
#'
#' @return A bdproto object.
#' @keywords bdproto
#' @family bdproto
#' @export
Expand Down
1 change: 0 additions & 1 deletion R/prior_breg.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ NULL
#' @param variable A [`character`] matched against existing predictors.
#' @param hyper A [`numeric`] estimate of the mean regression coefficients.
#' @param ip A [`numeric`] estimate between 0 and 1 of the inclusion probability of the target variable (Default: \code{NULL}).
#' @param ... Variables passed on to prior object.
#' @references
#' * Hugh Chipman, Edward I. George, Robert E. McCulloch, M. Clyde, Dean P. Foster, Robert A. Stine (2001), "The Practical Implementation of Bayesian Model Selection" Lecture Notes-Monograph Series, Vol. 38, pp. 65-134. Institute of Mathematical Statistics.
#' @seealso [`Prior-class`]
Expand Down
2 changes: 1 addition & 1 deletion R/prior_inla.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ NULL
#' and a precision of \code{0.001}.
#'
#' * \code{"clinear"}: Prior that places a constraint on the linear coefficients of a model
#' so as that the coefficient is in a specified interval \code{[lower,upper]}. Specified through hyper these values can be
#' so as that the coefficient is in a specified interval \code{"c(lower,upper)"}. Specified through hyper these values can be
#' negative, positive or infinite.
#'
#' * \code{"spde"}, specifically \code{'prior.range'} and \code{'prior.sigma'}: Specification of
Expand Down
2 changes: 0 additions & 2 deletions R/priors.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ methods::setMethod(

}
)
#' @include utils.R bdproto.R bdproto-priorlist.R bdproto-prior.R
NULL

#' Creates a new PriorList object
#'
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ knitr::opts_chunk$set(
[![Codecov Status](https://codecov.io/gh/iiasa/ibis.iSDM/branch/master/graph/badge.svg)](https://app.codecov.io/gh/iiasa/ibis.iSDM?branch=master)
<!-- badges: end -->

The **ibis.iSDM** package provides a series of convenience functions to fit integrated Species Distribution Models (iSDMs). With integrated models we generally refer to SDMs that incorporate information from different biodiversity datasets, external parameters such as priors or offsets with respect to certain variables and regions. See [Fletcher et al. (2019)](https://doi.org/10.1002/ecy.2710) and [Isaac et al. (2020)](https://linkinghub.elsevier.com/retrieve/pii/S0169534719302551) for an introduction to iSDMs.
The **ibis.iSDM** package provides a series of convenience functions to fit integrated Species Distribution Models (iSDMs). With integrated models we generally refer to SDMs that incorporate information from different biodiversity datasets, external parameters such as priors or offsets with respect to certain variables and regions. See Fletcher et al. (2019) and [Isaac et al. (2020)](https://linkinghub.elsevier.com/retrieve/pii/S0169534719302551) for an introduction to iSDMs.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ The **ibis.iSDM** package provides a series of convenience functions to
fit integrated Species Distribution Models (iSDMs). With integrated
models we generally refer to SDMs that incorporate information from
different biodiversity datasets, external parameters such as priors or
offsets with respect to certain variables and regions. See [Fletcher et
al. (2019)](https://doi.org/10.1002/ecy.2710) and [Isaac et
offsets with respect to certain variables and regions. See Fletcher et
al. (2019) and [Isaac et
al. (2020)](https://linkinghub.elsevier.com/retrieve/pii/S0169534719302551)
for an introduction to iSDMs.

Expand Down
2 changes: 0 additions & 2 deletions man/BREGPrior.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/INLAPrior.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/Prior-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/PriorList-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/add_constraint.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/add_constraint_connectivity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/add_constraint_dispersal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/predictor_homogenize_na.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb1ca02

Please sign in to comment.