PointedSDMs
Simplify the construction of integrated species distribution models (ISDMs) for large collections of heterogeneous data.
https://github.com/philipmostert/pointedsdms
Category: Biosphere
Sub Category: Species Distribution Modeling
Last synced: about 10 hours ago
JSON representation
Repository metadata
Wrapper function for 'inlabru' for modeling species distribution models from disparate datasets.
- Host: GitHub
- URL: https://github.com/philipmostert/pointedsdms
- Owner: PhilipMostert
- Created: 2021-05-19T10:01:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-24T10:03:56.000Z (3 months ago)
- Last Synced: 2025-10-22T05:59:46.758Z (2 months ago)
- Language: R
- Size: 19 MB
- Stars: 26
- Watchers: 4
- Forks: 6
- Open Issues: 1
- Releases: 4
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# PointedSDMs
[](https://github.com/PhilipMostert/PointedSDMs/actions/workflows/R-CMD-check.yaml)[](https://app.codecov.io/gh/PhilipMostert/PointedSDMs?branch=ChangingToR6) [](https://zenodo.org/badge/latestdoi/368823136)
The goal of *PointedSDMs* is to simplify the construction of integrated species distribution models (ISDMs) for large collections of heterogeneous data. It does so by building wrapper functions around [inlabru](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13168), which uses the [INLA methodology](https://rss.onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-9868.2008.00700.x) to estimate a class of latent Gaussian models.
## Installation
You can install the development version of PointedSDMs from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("PhilipMostert/PointedSDMs")
```
or directly through CRAN using:
``` r
install.packages('PointedSDMs')
```
## Package functionality
*PointedSDMs* includes a selection of functions used to streamline the construction of ISDMs as well and perform model cross-validation. The core functions of the package are:
| Function name | Function description |
|-------------------|-----------------------------------------------------|
| `startISDM()` | Initialize and specify the components used in the integrated model. |
| `startSpecies()` | Initialize and specify the components used in the multi-species integrated model. |
| `blockedCV()` | Perform spatial blocked cross-validation. |
| `fitISDM()` | Estimate and preform inference on the integrated model. |
| `datasetOut()` | Perform dataset-out cross-validation, which calculates the impact individual datasets have on the full model. |
The function `intModel()` produces an [R6](https://github.com/r-lib/R6) object, and as a result there are various *slot functions* available to further specify the components of the model. These *slot functions* include:
| `intModel()` slot function | Function description |
|--------------------|----------------------------------------------------|
| `` `.$help()` `` | Show documentation for each of the slot functions. |
| `` `.$plot()` `` | Used to create a plot of the available data. The output of this function is an object of class [`gg`](https://github.com/tidyverse/ggplot2). |
| `` `.$addBias()` `` | Add an additional spatial field to a dataset to account for sampling bias in unstructured datasets. |
| `` `.$updateFormula()` `` | Used to update a formula for a process. The idea is to start specify the full model with `startISDM()`, and then thin components per dataset with this function. |
| `` `.$updateComponents()` `` | Change or add new components used by [inlabru](https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13168) in the integrated model. |
| `` `.$priorsFixed()` `` | Change the specification of the prior distribution for the fixed effects in the model. |
| `` `.$specifySpatial()` `` | Specify the spatial field in the model using penalizing complexity (PC) priors. |
| `` `.$spatialBlock()` `` | Used to specify how the points are spatially blocked. Spatial cross-validation is subsequently performed using `blockedCV()`. |
| `` `.$addSamplers()` `` | Function to add an integration domain for the PO datasets. |
| `` `.$specifyRandom()` `` | Specify the priors for the random effects in the model. |
| `` `.$changeLink()` `` | Change the link function of a process. |
## Example
This is a basic example which shows you how to specify and run an integrated model, using three disparate datasets containing locations of the solitary tinamou (*Tinamus solitarius)*.
```{r setup, include=FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
```
```{r example}
library(PointedSDMs)
library(ggplot2)
library(terra)
```
```{r data}
bru_options_set(inla.mode = "experimental")
#Load data in
data("SolitaryTinamou")
projection <- "+proj=longlat +ellps=WGS84"
species <- SolitaryTinamou$datasets
covariates <- terra::rast(system.file('extdata/SolitaryTinamouCovariates.tif',
package = "PointedSDMs"))
mesh <- SolitaryTinamou$mesh
```
Setting up the model is done easily with `startISDM()`, where we specify the required components of the model:
```{r intModel, message = FALSE, warning = FALSE}
#Specify model -- here we run a model with one spatial covariate and a shared spatial field
model <- startISDM(species, spatialCovariates = covariates,
Projection = projection, Mesh = mesh, responsePA = 'Present')
```
We can also make a quick plot of where the species are located using `` `.$plot()` ``:
```{r plot, warning = FALSE, message = FALSE, fig.width=8, fig.height=5}
region <- SolitaryTinamou$region
model$plot(Boundary = FALSE) +
geom_sf(data = st_boundary(region))
```
To improve stability, we specify priors for the intercepts of the model using `` `.$priorsFixed()` ``
```{r specifyPriors}
model$priorsFixed(Effect = 'Intercept',
mean.linear = 0,
prec.linear = 1)
```
And *PC* priors for the spatial field using `` `.$specifySpatial()` ``:
```{r specifySpatial}
model$specifySpatial(sharedSpatial = TRUE,
prior.range = c(0.2, 0.1),
prior.sigma = c(0.1, 0.1))
```
We can then estimate the parameters in the model using the `fitISDM()` function:
```{r fitISDM, warning = FALSE, message = FALSE}
modelRun <- fitISDM(model, options = list(control.inla =
list(int.strategy = 'eb'),
safe = TRUE))
summary(modelRun)
```
*PointedSDMs* also includes generic predict and plot functions:
```{r predict_and_plot, warning = FALSE, message = FALSE, fig.width=8, fig.height=5}
predictions <- predict(modelRun, mesh = mesh,
mask = region,
spatial = TRUE,
fun = 'linear')
plot(predictions, variable = c('mean', 'sd'))
```
Owner metadata
- Name: Philip Mostert
- Login: PhilipMostert
- Email:
- Kind: user
- Description:
- Website:
- Location: Trondheim, Norway
- Twitter:
- Company: Norwegian University of Science and Technology
- Icon url: https://avatars.githubusercontent.com/u/81858712?v=4
- Repositories: 4
- Last ynced at: 2023-03-03T16:22:15.112Z
- Profile URL: https://github.com/PhilipMostert
GitHub Events
Total
- Create event: 2
- Release event: 1
- Issues event: 18
- Watch event: 3
- Issue comment event: 30
- Push event: 31
- Pull request event: 2
- Fork event: 1
Last Year
- Create event: 2
- Release event: 1
- Issues event: 18
- Watch event: 2
- Issue comment event: 30
- Push event: 30
- Pull request event: 2
- Fork event: 1
Committers metadata
Last synced: about 2 months ago
Total Commits: 1,376
Total Committers: 44
Avg Commits per committer: 31.273
Development Distribution Score (DDS): 0.613
Commits in past year: 47
Committers in past year: 2
Avg Commits per committer in past year: 23.5
Development Distribution Score (DDS) in past year: 0.128
| Name | Commits | |
|---|---|---|
| Philip Mostert | p****t@n****o | 533 |
| Philip Mostert | p****m@d****o | 69 |
| Philip Mostert | p****m@d****o | 62 |
| Philip Mostert | p****m@d****o | 54 |
| Philip Mostert | p****m@d****o | 52 |
| Philip Mostert | p****m@d****o | 52 |
| Philip Mostert | p****m@d****o | 50 |
| Philip Mostert | p****m@d****o | 48 |
| Philip Mostert | p****m@d****o | 45 |
| Philip Mostert | p****m@d****o | 42 |
| Philip Mostert | p****m@P****l | 37 |
| Philip Mostert | p****m@d****o | 36 |
| Philip Mostert | p****m@d****o | 32 |
| Philip Mostert | p****m@d****o | 26 |
| Philip Mostert | p****m@d****o | 25 |
| Philip Mostert | p****m@d****o | 24 |
| Philip Mostert | p****m@d****o | 19 |
| Philip Mostert | p****m@d****o | 17 |
| Philip Mostert | p****m@d****o | 17 |
| Philip Mostert | p****m@d****o | 16 |
| Philip Mostert | p****m@d****o | 15 |
| Philip Mostert | p****m@d****o | 14 |
| Philip Mostert | p****m@d****o | 12 |
| Philip Mostert | p****m@d****o | 12 |
| Philip Mostert | p****m@d****o | 10 |
| Philip Mostert | p****m@d****o | 9 |
| Philip Mostert | p****m@d****o | 7 |
| Finn Lindgren | F****n@g****m | 6 |
| Philip Mostert | p****m@d****o | 4 |
| RRTogunov | r****v@g****m | 3 |
| and 14 more... | ||
Committer domains:
- vpn-10-50-238-127.vpn-a.ntnu.no: 1
- dhcp-10-24-6-86.wlan.ntnu.no: 1
- dhcp-10-24-5-229.wlan.ntnu.no: 1
- dhcp-10-24-31-45.wlan.ntnu.no: 1
- dhcp-10-24-28-84.wlan.ntnu.no: 1
- dhcp-10-24-22-246.wlan.ntnu.no: 1
- dhcp-10-24-20-92.wlan.ntnu.no: 1
- dhcp-10-24-20-55.wlan.ntnu.no: 1
- dhcp-10-24-106-153.wlan.ntnu.no: 1
- dhcp-10-24-22-212.wlan.ntnu.no: 1
- dhcp-10-24-22-247.wlan.ntnu.no: 1
- dhcp-10-24-5-189.wlan.ntnu.no: 1
- dhcp-10-24-6-104.wlan.ntnu.no: 1
- vpn-10-50-238-12.vpn-a.ntnu.no: 1
- dhcp-10-24-20-102.wlan.ntnu.no: 1
- dhcp-10-24-20-192.wlan.ntnu.no: 1
- dhcp-10-24-6-146.wlan.ntnu.no: 1
- dhcp-10-24-21-144.wlan.ntnu.no: 1
- dhcp-10-24-23-27.wlan.ntnu.no: 1
- dhcp-10-24-20-11.wlan.ntnu.no: 1
- dhcp-10-24-22-254.wlan.ntnu.no: 1
- dhcp-10-24-23-62.wlan.ntnu.no: 1
- dhcp-10-24-23-35.wlan.ntnu.no: 1
- dhcp-10-24-22-183.wlan.ntnu.no: 1
- dhcp-10-24-20-157.wlan.ntnu.no: 1
- dhcp-10-24-23-217.wlan.ntnu.no: 1
- dhcp-10-24-21-192.wlan.ntnu.no: 1
- dhcp-10-24-20-125.wlan.ntnu.no: 1
- dhcp-10-24-23-41.wlan.ntnu.no: 1
- dhcp-10-24-22-154.wlan.ntnu.no: 1
- dhcp-10-24-21-201.wlan.ntnu.no: 1
- dhcp-10-24-22-32.wlan.ntnu.no: 1
- dhcp-10-24-21-173.wlan.ntnu.no: 1
- dhcp-10-24-23-113.wlan.ntnu.no: 1
- dhcp-10-24-22-197.wlan.ntnu.no: 1
- dhcp-10-24-23-55.wlan.ntnu.no: 1
- dhcp-10-24-22-145.wlan.ntnu.no: 1
- dhcp-10-24-21-189.wlan.ntnu.no: 1
- dhcp-10-24-21-41.wlan.ntnu.no: 1
- dhcp-10-24-20-62.wlan.ntnu.no: 1
- ntnu.no: 1
Issue and Pull Request metadata
Last synced: about 2 months ago
Total issues: 28
Total pull requests: 4
Average time to close issues: 25 days
Average time to close pull requests: about 13 hours
Total issue authors: 17
Total pull request authors: 2
Average comments per issue: 3.14
Average comments per pull request: 0.75
Merged pull request: 4
Bot issues: 0
Bot pull requests: 0
Past year issues: 11
Past year pull requests: 2
Past year average time to close issues: 18 days
Past year average time to close pull requests: about 20 hours
Past year issue authors: 6
Past year pull request authors: 1
Past year average comments per issue: 3.73
Past year average comments per pull request: 0.5
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- rondon-d (4)
- melissaminter1602 (4)
- RRTogunov (3)
- klaassenmo (3)
- sjbonner (2)
- thomasp85 (1)
- BrentPease1 (1)
- cmsp501-commits (1)
- lganley (1)
- laurawhipple (1)
- RPJorge (1)
- oharar (1)
- hrlai (1)
- rsbivand (1)
- ManuelSpinola (1)
Top Pull Request Authors
- finnlindgren (2)
- RRTogunov (2)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 3
-
Total downloads:
- cran: 739 last-month
- Total dependent packages: 1 (may contain duplicates)
- Total dependent repositories: 1 (may contain duplicates)
- Total versions: 15
- Total maintainers: 1
proxy.golang.org: github.com/philipmostert/pointedsdms
- Homepage:
- Documentation: https://pkg.go.dev/github.com/philipmostert/pointedsdms#section-documentation
- Licenses:
- Latest release: v2.1.3+incompatible (published 11 months ago)
- Last Synced: 2025-10-29T20:41:33.392Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
proxy.golang.org: github.com/PhilipMostert/PointedSDMs
- Homepage:
- Documentation: https://pkg.go.dev/github.com/PhilipMostert/PointedSDMs#section-documentation
- Licenses:
- Latest release: v2.1.3+incompatible (published 11 months ago)
- Last Synced: 2025-10-29T20:41:34.014Z (about 2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
cran.r-project.org: PointedSDMs
Fit Models Derived from Point Processes to Species Distributions using 'inlabru'
- Homepage: https://github.com/PhilipMostert/PointedSDMs
- Documentation: http://cran.r-project.org/web/packages/PointedSDMs/PointedSDMs.pdf
- Licenses: GPL (≥ 3)
- Latest release: 2.1.4 (published 4 months ago)
- Last Synced: 2025-10-29T20:41:34.852Z (about 2 months ago)
- Versions: 13
- Dependent Packages: 1
- Dependent Repositories: 1
- Downloads: 739 Last month
-
Rankings:
- Stargazers count: 10.949%
- Dependent packages count: 18.134%
- Forks count: 20.985%
- Average: 23.64%
- Dependent repos count: 23.828%
- Downloads: 44.301%
- Maintainers (1)
Dependencies
- R >= 4.1 depends
- ggplot2 * depends
- inlabru >= 2.5 depends
- methods * depends
- stats * depends
- R.devices * imports
- R6 * imports
- blockCV * imports
- raster * imports
- sp >= 1.4 imports
- INLA >= 21.08.31 suggests
- RColorBrewer * suggests
- USAboundaries * suggests
- covr * suggests
- cowplot * suggests
- ggmap * suggests
- ggpolypath * suggests
- kableExtra * suggests
- knitr * suggests
- rasterVis * suggests
- rmarkdown * suggests
- sf * suggests
- sn * suggests
- spocc * suggests
- testthat >= 3.0.0 suggests
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v1 composite
- actions/checkout v2 composite
- r-lib/actions/pr-fetch v1 composite
- r-lib/actions/pr-push v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v1 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
Score: 13.68937574308997