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 14 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-30T12:53:51.000Z (29 days ago)
- Last Synced: 2025-04-18T04:11:10.438Z (10 days ago)
- Language: R
- Size: 19.2 MB
- Stars: 26
- Watchers: 3
- Forks: 6
- Open Issues: 6
- 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: 11
- Watch event: 3
- Issue comment event: 10
- Push event: 18
- Pull request event: 2
- Fork event: 1
Last Year
- Create event: 2
- Release event: 1
- Issues event: 11
- Watch event: 3
- Issue comment event: 10
- Push event: 18
- Pull request event: 2
- Fork event: 1
Committers metadata
Last synced: 7 days ago
Total Commits: 1,354
Total Committers: 44
Avg Commits per committer: 30.773
Development Distribution Score (DDS): 0.623
Commits in past year: 176
Committers in past year: 3
Avg Commits per committer in past year: 58.667
Development Distribution Score (DDS) in past year: 0.051
Name | Commits | |
---|---|---|
Philip Mostert | p****t@n****o | 511 |
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: 1 day ago
Total issues: 24
Total pull requests: 2
Average time to close issues: 21 days
Average time to close pull requests: about 13 hours
Total issue authors: 15
Total pull request authors: 2
Average comments per issue: 2.63
Average comments per pull request: 1.0
Merged pull request: 2
Bot issues: 0
Bot pull requests: 0
Past year issues: 11
Past year pull requests: 2
Past year average time to close issues: 2 days
Past year average time to close pull requests: about 13 hours
Past year issue authors: 5
Past year pull request authors: 2
Past year average comments per issue: 1.73
Past year average comments per pull request: 1.0
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- melissaminter1602 (4)
- klaassenmo (3)
- RRTogunov (3)
- rondon-d (2)
- sjbonner (2)
- lgamador (1)
- harshadkarandikar (1)
- ManuelSpinola (1)
- rsbivand (1)
- hrlai (1)
- oharar (1)
- RPJorge (1)
- laurawhipple (1)
- BrentPease1 (1)
- thomasp85 (1)
Top Pull Request Authors
- RRTogunov (1)
- finnlindgren (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 1
-
Total downloads:
- cran: 316 last-month
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 12
- Total maintainers: 1
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.3 (published 4 months ago)
- Last Synced: 2025-04-26T19:03:24.536Z (1 day ago)
- Versions: 12
- Dependent Packages: 1
- Dependent Repositories: 1
- Downloads: 316 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 v1 composite
- r-lib/actions/setup-r v2 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.015116639502832