ssdtools
An R package to fit and plot Species Sensitivity Distributions, cumulative probability distributions which are fitted to toxicity concentrations for different species.
https://github.com/bcgov/ssdtools
Category: Biosphere
Sub Category: Species Distribution Modeling
Keywords
ecotoxicology env rstats species-sensitivity-distribution
Keywords from Contributors
ssd water-quality-guideline assertion checkr
Last synced: about 8 hours ago
JSON representation
Repository metadata
An R package to fit and plot Species Sensitivity Distributions (SSDs)
- Host: GitHub
- URL: https://github.com/bcgov/ssdtools
- Owner: bcgov
- License: apache-2.0
- Created: 2017-11-28T22:29:01.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2025-12-15T17:10:32.000Z (10 days ago)
- Last Synced: 2025-12-18T13:36:55.862Z (7 days ago)
- Topics: ecotoxicology, env, rstats, species-sensitivity-distribution
- Language: R
- Homepage: https://bcgov.github.io/ssdtools/
- Size: 97.1 MB
- Stars: 35
- Watchers: 8
- Forks: 19
- Open Issues: 25
- Releases: 13
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Support: .github/SUPPORT.md
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ssdtools
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](https://github.com/bcgov/ssdtools/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/bcgov/ssdtools)
[](https://cran.r-project.org/package=ssdtools)

`ssdtools` is an R package to fit and plot Species Sensitivity Distributions (SSD).
SSDs are cumulative probability distributions which are fitted to toxicity concentrations for different species as described by Posthuma et al. (2001).
The ssdtools package uses Maximum Likelihood to fit distributions such as the log-normal, log-logistic, log-Gumbel (also known as the inverse Weibull), gamma, Weibull and log-normal log-normal mixture.
Multiple distributions can be averaged using Akaike Information Criteria.
Confidence intervals on hazard concentrations and proportions are produced by bootstrapping.
`ssdtools` can handle censored data with two limitations.
It is currently only possible to model average when the distributions have the same number of parameters and confidence intervals can only be estimated using non-parametric (as opposed to parametric) bootstrapping.
## Introduction
The dependency [`ssddata`](https://github.com/open-AIMS/ssddata) provides example data sets for several chemicals including Boron.
The [ECOTOX](https://cfpub.epa.gov/ecotox/) Knowledgebase is another source of toxicity concentrations for over 12,000 chemicals.
```{r, message=FALSE}
library(ssdtools)
ssddata::ccme_boron
```
The six default distributions are fit using `ssd_fit_dists()`
```{r}
fits <- ssd_fit_dists(ssddata::ccme_boron)
```
and can be quickly plotted using `autoplot`
```{r, warning = FALSE, message = FALSE, fig.alt="A plot of the data and fitted distributions"}
autoplot(fits)
```
The goodness of fit can be assessed using `ssd_gof`
```{r}
ssd_gof(fits, wt = TRUE)
```
and the model-averaged 5% hazard concentration estimated (with bootstrapping to get confidence intervals) using `ssd_hc`.
```{r}
withr::with_seed(99, {
hc5 <- ssd_hc(fits, ci = TRUE)
})
print(hc5)
```
Model-averaged predictions complete with confidence intervals can also be estimated by parametric bootstrapping using the `stats` generic `predict`.
```{r, eval=FALSE}
boron_pred <- predict(fits, ci = TRUE)
```
The predictions can be plotted together with the original data using `ssd_plot`.
```{r, fig.alt="A plot of the data and model-averaged prediction with confidence intervals"}
library(ggplot2)
theme_set(theme_bw())
ssd_plot(ssddata::ccme_boron, boron_pred,
shape = "Group", color = "Group", label = "Species",
xlab = "Concentration (mg/L)", ribbon = TRUE
) +
expand_limits(x = 3000) +
scale_colour_ssd()
```
## Information
Get started with ssdtools at .
A shiny app to allow non-R users to interface with ssdtools is available at .
For the latest changes to the development version see the [NEWS](https://bcgov.github.io/ssdtools/news/) file.
For recent developments in SSD modeling including a review of existing software see:
*Fox, D.R., et al. 2021. Recent Developments in Species Sensitivity Distribution Modeling. Environ Toxicol Chem 40(2): 293–308. .*
## Citation
```{r, comment = "", echo = FALSE}
citation("ssdtools")
```
## Installation
### Release
To install the latest release version from [CRAN](https://CRAN.R-project.org/package=ssdtools).
```r
install.packages("ssdtools")
```
The website for the release version is at .
### Development
To install the development version from [GitHub](https://github.com/bcgov/ssdtools)
```r
# install.packages("remotes")
remotes::install_github("bcgov/ssdtools")
```
or from [r-universe](https://bcgov.r-universe.dev/ssdtools).
```r
install.packages("ssdtools", repos = c("https://bcgov.r-universe.dev", "https://cloud.r-project.org"))
```
The website for the development version is at .
### Getting Help or Reporting an Issue
To report bugs/issues/feature requests, please file an [issue](https://github.com/bcgov/ssdtools/issues/).
### Contribution
If you would like to contribute to the package, please see our
[CONTRIBUTING](https://github.com/bcgov/ssdtools/blob/master/.github/CONTRIBUTING.md) guidelines.
### Code of Conduct
Please note that the ssdtools project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.
## References
Posthuma, L., Suter II, G.W., and Traas, T.P. 2001. Species Sensitivity Distributions in Ecotoxicology. CRC Press.
```{r, results = "asis", echo = FALSE}
cat(ssdtools::ssd_licensing_md())
```
Citation (CITATION.cff)
cff-version: "1.2.0"
authors:
- family-names: Thorley
given-names: Joe
orcid: "https://orcid.org/0000-0002-7683-4592"
- family-names: Fisher
given-names: Rebecca
orcid: "https://orcid.org/0000-0001-5148-6731"
- family-names: Fox
given-names: David
orcid: "https://orcid.org/0000-0002-3178-7243"
- family-names: Schwarz
given-names: Carl
orcid: "https://orcid.org/0000-0002-8525-862X"
contact:
- family-names: Thorley
given-names: Joe
orcid: "https://orcid.org/0000-0002-7683-4592"
doi: 10.5281/zenodo.14609128
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Thorley
given-names: Joe
orcid: "https://orcid.org/0000-0002-7683-4592"
- family-names: Fisher
given-names: Rebecca
orcid: "https://orcid.org/0000-0001-5148-6731"
- family-names: Fox
given-names: David
orcid: "https://orcid.org/0000-0002-3178-7243"
- family-names: Schwarz
given-names: Carl
orcid: "https://orcid.org/0000-0002-8525-862X"
date-published: 2025-01-28
doi: 10.21105/joss.07492
issn: 2475-9066
issue: 105
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 7492
title: "ssdtools v2: An R package to fit Species Sensitivity
Distributions"
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.07492"
volume: 10
title: "ssdtools v2: An R package to fit Species Sensitivity
Distributions"
Owner metadata
- Name: bcgov
- Login: bcgov
- Email: Developer.Experience@gov.bc.ca
- Kind: organization
- Description: This is the home for code that is open
- Website: https://github.com/bcgov/BC-Policy-Framework-For-GitHub
- Location: Canada
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/916280?v=4
- Repositories: 2150
- Last ynced at: 2024-12-16T17:13:08.511Z
- Profile URL: https://github.com/bcgov
GitHub Events
Total
- Create event: 12
- Issues event: 64
- Release event: 4
- Watch event: 4
- Delete event: 10
- Issue comment event: 75
- Push event: 102
- Pull request review comment event: 2
- Pull request review event: 20
- Pull request event: 62
- Fork event: 3
Last Year
- Create event: 6
- Release event: 2
- Issues event: 53
- Watch event: 3
- Delete event: 7
- Issue comment event: 54
- Push event: 47
- Pull request review comment event: 2
- Pull request event: 44
- Pull request review event: 16
- Fork event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 2,119
Total Committers: 18
Avg Commits per committer: 117.722
Development Distribution Score (DDS): 0.049
Commits in past year: 285
Committers in past year: 6
Avg Commits per committer in past year: 47.5
Development Distribution Score (DDS) in past year: 0.07
| Name | Commits | |
|---|---|---|
| Joe Thorley | j****e@p****a | 2015 |
| Seb Dalgarno | s****b@p****a | 21 |
| Duncan Kennedy | d****n@p****a | 16 |
| Nadine Hussein | n****3@g****m | 13 |
| Rebecca Fisher | R****r@a****u | 10 |
| Eduard Szöcs | e****s@b****m | 8 |
| atillmanns | a****s@g****a | 8 |
| Sarah Lyons | s****h@p****a | 7 |
| stephhazlitt | s****t@g****a | 6 |
| Nan-Hung Hsieh | n****h@c****u | 4 |
| cschwarz-stat-sfu-ca | c****z@s****a | 3 |
| Nan-Hung Hsieh | n****3@h****m | 2 |
| Ali | a****i@g****a | 1 |
| Hadley Wickham | h****m@g****m | 1 |
| Iain Moodie | 3****e | 1 |
| Sergio Ibarra Espinosa | z****a@g****m | 1 |
| Rebecca Fisher | r****r@A****u | 1 |
| repo-mountie[bot] | 4****] | 1 |
Committer domains:
- poissonconsulting.ca: 4
- gov.bc.ca: 3
- aims-7bqq564.aims.gov.au: 1
- stat.sfu.ca: 1
- cvm.tamu.edu: 1
- basf.com: 1
- aims.gov.au: 1
Issue and Pull Request metadata
Last synced: 10 days ago
Total issues: 129
Total pull requests: 189
Average time to close issues: 8 months
Average time to close pull requests: 3 days
Total issue authors: 18
Total pull request authors: 11
Average comments per issue: 1.53
Average comments per pull request: 0.11
Merged pull request: 146
Bot issues: 3
Bot pull requests: 0
Past year issues: 34
Past year pull requests: 48
Past year average time to close issues: 8 days
Past year average time to close pull requests: 7 days
Past year issue authors: 4
Past year pull request authors: 5
Past year average comments per issue: 0.44
Past year average comments per pull request: 0.23
Past year merged pull request: 19
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- joethorley (98)
- beckyfisher (9)
- sebdalgarno (3)
- repo-mountie[bot] (3)
- hux123x (2)
- jenni-gnz (2)
- atillmanns (1)
- kateECmill (1)
- SantoClau (1)
- d-morrison (1)
- aylapear (1)
- Enchufa2 (1)
- SMARKICH (1)
- ScottCoffin (1)
- yuichiwsk (1)
Top Pull Request Authors
- joethorley (166)
- dunkenwg (6)
- aylapear (4)
- eduardszoecs (3)
- beckyfisher (2)
- nanhung (2)
- d-morrison (2)
- sarahLy9 (1)
- hadley (1)
- irmoodie (1)
- sebdalgarno (1)
Top Issue Labels
- Priority: 2 High (32)
- Effort: 2 Medium (29)
- Effort: 1 Low (25)
- Difficulty: 3 Advanced (25)
- Type: Enhancement (25)
- Difficulty: 2 Intermediate (23)
- Priority: 3 Medium (19)
- Type: Refactor (17)
- Difficulty: 1 Simple (16)
- Priority: 1 Critical (11)
- Type: Docs (11)
- Effort: 3 High (9)
- Type: Bug (7)
- Type: User Question (4)
- Priority: 4 Low (3)
- Technical Committee :busts_in_silhouette: (3)
- Type: Testing (2)
- FAQ (1)
Top Pull Request Labels
Package metadata
- Total packages: 2
-
Total downloads:
- cran: 1,411 last-month
- Total dependent packages: 1 (may contain duplicates)
- Total dependent repositories: 4 (may contain duplicates)
- Total versions: 47
- Total maintainers: 1
proxy.golang.org: github.com/bcgov/ssdtools
- Homepage:
- Documentation: https://pkg.go.dev/github.com/bcgov/ssdtools#section-documentation
- Licenses: apache-2.0
- Latest release: v2.4.0+incompatible (published 3 months ago)
- Last Synced: 2025-12-22T00:03:07.875Z (3 days ago)
- Versions: 21
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.401%
- Average: 5.583%
- Dependent repos count: 5.764%
cran.r-project.org: ssdtools
Species Sensitivity Distributions
- Homepage: https://github.com/bcgov/ssdtools
- Documentation: http://cran.r-project.org/web/packages/ssdtools/ssdtools.pdf
- Licenses: Apache License (== 2.0) | file LICENSE
- Latest release: 2.5.0 (published 24 days ago)
- Last Synced: 2025-12-22T00:03:06.171Z (3 days ago)
- Versions: 26
- Dependent Packages: 1
- Dependent Repositories: 4
- Downloads: 1,411 Last month
-
Rankings:
- Forks count: 4.584%
- Stargazers count: 9.921%
- Average: 13.55%
- Dependent repos count: 14.503%
- Dependent packages count: 18.104%
- Downloads: 20.64%
- Maintainers (1)
Dependencies
- R >= 4.1 depends
- Rcpp * imports
- TMB >= 1.7.20 imports
- VGAM * imports
- abind * imports
- chk >= 0.7.0 imports
- doFuture * imports
- foreach * imports
- furrr * imports
- generics * imports
- ggplot2 * imports
- goftest * imports
- graphics * imports
- grid * imports
- lifecycle * imports
- parallel * imports
- plyr * imports
- purrr * imports
- scales * imports
- ssddata * imports
- stats * imports
- stringr * imports
- tibble * imports
- universals * imports
- utils * imports
- R.rsp * suggests
- covr * suggests
- dplyr * suggests
- fitdistrplus * suggests
- future * suggests
- glue * suggests
- grDevices * suggests
- knitr * suggests
- magrittr * suggests
- mle.tools * suggests
- readr * suggests
- reshape2 * suggests
- rlang * suggests
- rmarkdown * suggests
- testthat * suggests
- tidyr * suggests
- tidyverse * suggests
- withr * suggests
Score: 14.241013559808945