pointedsdms
Wrapper function for 'inlabru' for modeling species distribution models from disparate datasets.
Science Score: 59.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: wiley.com, zenodo.org -
✓Committers with academic emails
41 of 44 committers (93.2%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.1%) to scientific vocabulary
Last synced: 6 months ago
·
JSON representation
Repository
Wrapper function for 'inlabru' for modeling species distribution models from disparate datasets.
Basic Info
- Host: GitHub
- Owner: PhilipMostert
- Language: R
- Default Branch: main
- Size: 19.3 MB
Statistics
- Stars: 26
- Watchers: 4
- Forks: 6
- Open Issues: 5
- Releases: 4
Created almost 5 years ago
· Last pushed 6 months ago
Metadata Files
Readme
Changelog
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
- Name: Philip Mostert
- Login: PhilipMostert
- Kind: user
- Location: Trondheim, Norway
- Company: Norwegian University of Science and Technology
- Repositories: 4
- Profile: https://github.com/PhilipMostert
GitHub Events
Total
- Create event: 2
- Release event: 1
- Issues event: 15
- Watch event: 3
- Issue comment event: 16
- Push event: 30
- Pull request event: 2
- Fork event: 1
Last Year
- Create event: 2
- Release event: 1
- Issues event: 15
- Watch event: 3
- Issue comment event: 16
- Push event: 30
- Pull request event: 2
- Fork event: 1
Committers
Last synced: 6 months ago
Top Committers
| 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 (Top 20 + Academic)
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
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 25
- Total pull requests: 2
- Average time to close issues: 26 days
- Average time to close pull requests: about 13 hours
- Total issue authors: 15
- Total pull request authors: 2
- Average comments per issue: 2.6
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 10
- Pull requests: 1
- Average time to close issues: 18 days
- Average time to close pull requests: about 20 hours
- Issue authors: 5
- Pull request authors: 1
- Average comments per issue: 1.7
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- rondon-d (4)
- melissaminter1602 (4)
- klaassenmo (3)
- RRTogunov (3)
- sjbonner (2)
- lgamador (1)
- harshadkarandikar (1)
- ManuelSpinola (1)
- rsbivand (1)
- hrlai (1)
- oharar (1)
- RPJorge (1)
- laurawhipple (1)
- cmsp501-commits (1)
- BrentPease1 (1)
Pull Request Authors
- finnlindgren (2)
- RRTogunov (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- cran 159 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
- Documentation: https://pkg.go.dev/github.com/PhilipMostert/PointedSDMs#section-documentation
-
Latest release: v2.1.3+incompatible
published about 1 year ago
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced:
6 months ago
proxy.golang.org: github.com/philipmostert/pointedsdms
- Documentation: https://pkg.go.dev/github.com/philipmostert/pointedsdms#section-documentation
-
Latest release: v2.1.3+incompatible
published about 1 year ago
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced:
6 months ago
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
- License: GPL (≥ 3)
-
Latest release: 2.1.4
published 6 months ago
Rankings
Stargazers count: 10.9%
Dependent packages count: 18.1%
Forks count: 21.0%
Average: 23.6%
Dependent repos count: 23.8%
Downloads: 44.3%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- 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
.github/workflows/R-CMD-check.yaml
actions
- 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
.github/workflows/pkgdown.yaml
actions
- 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
.github/workflows/pr-commands.yaml
actions
- 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
.github/workflows/test-coverage.yaml
actions
- 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