A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

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 citz flnr shiny

Last synced: about 24 hours ago
JSON representation

Repository metadata

An R package to fit and plot Species Sensitivity Distributions (SSDs)

README.Rmd

          ---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# ssdtools ssdtools logo of cumulative species sensitivity distribution with outlines of commonly used species as data


[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/bcgov/ssdtools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bcgov/ssdtools/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/bcgov/ssdtools/graph/badge.svg)](https://app.codecov.io/gh/bcgov/ssdtools)
[![CRAN status](https://www.r-pkg.org/badges/version/ssdtools)](https://cran.r-project.org/package=ssdtools)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.07492/status.svg)](https://doi.org/10.21105/joss.07492)


`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.

## 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)
```

and the model-averaged 5% hazard concentration estimated (with bootstrapping to get confidence intervals) using `ssd_hc`.

```{r}
set.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


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 1,898
Total Committers: 16
Avg Commits per committer: 118.625
Development Distribution Score (DDS): 0.051

Commits in past year: 351
Committers in past year: 7
Avg Commits per committer in past year: 50.143
Development Distribution Score (DDS) in past year: 0.148

Name Email Commits
Joe Thorley j****e@p****a 1801
Seb Dalgarno s****b@p****a 18
Duncan Kennedy d****n@p****a 14
Nadine Hussein n****3@g****m 13
Rebecca Fisher R****r@a****u 10
atillmanns a****s@g****a 8
Eduard Szöcs e****s@b****m 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
Hadley Wickham h****m@g****m 1
Sergio Ibarra Espinosa z****a@g****m 1
repo-mountie[bot] 4****] 1
Rebecca Fisher r****r@A****u 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 110
Total pull requests: 135
Average time to close issues: 8 months
Average time to close pull requests: 2 days
Total issue authors: 17
Total pull request authors: 11
Average comments per issue: 1.88
Average comments per pull request: 0.13
Merged pull request: 118
Bot issues: 3
Bot pull requests: 0

Past year issues: 26
Past year pull requests: 41
Past year average time to close issues: 17 days
Past year average time to close pull requests: 2 days
Past year issue authors: 5
Past year pull request authors: 7
Past year average comments per issue: 1.38
Past year average comments per pull request: 0.32
Past year merged pull request: 31
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/bcgov/ssdtools

Top Issue Authors

  • joethorley (83)
  • beckyfisher (6)
  • sebdalgarno (4)
  • repo-mountie[bot] (3)
  • jenni-gnz (2)
  • atillmanns (1)
  • kateECmill (1)
  • SantoClau (1)
  • d-morrison (1)
  • aylapear (1)
  • Enchufa2 (1)
  • SMARKICH (1)
  • ScottCoffin (1)
  • yuichiwsk (1)
  • HenrikBengtsson (1)

Top Pull Request Authors

  • joethorley (123)
  • dunkenwg (2)
  • eduardszoecs (2)
  • beckyfisher (1)
  • sebdalgarno (1)
  • krlmlr (1)
  • sarahLy9 (1)
  • aylapear (1)
  • nanhung (1)
  • hadley (1)
  • d-morrison (1)

Top Issue Labels

  • Priority: 2 High (40)
  • Effort: 2 Medium (35)
  • Type: Enhancement (34)
  • Difficulty: 2 Intermediate (32)
  • Effort: 1 Low (28)
  • Difficulty: 3 Advanced (27)
  • Priority: 3 Medium (21)
  • Difficulty: 1 Simple (17)
  • Type: Refactor (15)
  • Priority: 1 Critical (13)
  • Type: Docs (12)
  • Effort: 3 High (11)
  • Type: Bug (9)
  • Technical Committee :busts_in_silhouette: (9)
  • Type: Testing (3)
  • Priority: 4 Low (3)

Top Pull Request Labels


Package metadata

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.3.0 (published 2 months ago)
  • Last Synced: 2025-04-25T02:02:03.796Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 1
  • Dependent Repositories: 4
  • Downloads: 1,022 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

DESCRIPTION cran
  • 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: 13.678251081807012