{"id":14066775,"url":"https://github.com/bcgov/ssdtools","last_synced_at":"2025-10-22T06:00:03.053Z","repository":{"id":27287780,"uuid":"112396611","full_name":"bcgov/ssdtools","owner":"bcgov","description":"An R package to fit and plot Species Sensitivity Distributions (SSDs)","archived":false,"fork":false,"pushed_at":"2025-06-17T03:58:37.000Z","size":98544,"stargazers_count":33,"open_issues_count":23,"forks_count":18,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-25T01:57:51.604Z","etag":null,"topics":["ecotoxicology","env","rstats","species-sensitivity-distribution"],"latest_commit_sha":null,"homepage":"https://bcgov.github.io/ssdtools/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcgov.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":"CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-28T22:29:01.000Z","updated_at":"2025-05-01T16:17:42.000Z","dependencies_parsed_at":"2022-07-12T03:46:23.498Z","dependency_job_id":"56df67d0-2e44-41d1-8a84-04ec5cee4d46","html_url":"https://github.com/bcgov/ssdtools","commit_stats":{"total_commits":1839,"total_committers":15,"mean_commits":122.6,"dds":0.04567699836867867,"last_synced_commit":"4011ab2c40dfbe52b700ce1c3d0dc7969fe68c97"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/bcgov/ssdtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fssdtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fssdtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fssdtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fssdtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcgov","download_url":"https://codeload.github.com/bcgov/ssdtools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgov%2Fssdtools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267442443,"owners_count":24087798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecotoxicology","env","rstats","species-sensitivity-distribution"],"created_at":"2024-08-13T07:05:15.367Z","updated_at":"2025-10-22T06:00:03.046Z","avatar_url":"https://github.com/bcgov.png","language":"R","funding_links":[],"categories":["R","Biosphere"],"sub_categories":["Species Distribution Modeling"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# ssdtools \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"ssdtools logo of cumulative species sensitivity distribution with outlines of commonly used species as data\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![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)\n[![Codecov test coverage](https://codecov.io/gh/bcgov/ssdtools/graph/badge.svg)](https://app.codecov.io/gh/bcgov/ssdtools)\n[![CRAN status](https://www.r-pkg.org/badges/version/ssdtools)](https://cran.r-project.org/package=ssdtools)\n![CRAN downloads](https://cranlogs.r-pkg.org/badges/ssdtools)\n\u003c!-- badges: end --\u003e\n\n`ssdtools` is an R package to fit and plot Species Sensitivity Distributions (SSD). \n\nSSDs are cumulative probability distributions which are fitted to toxicity concentrations for different species as described by Posthuma et al. (2001).\nThe 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.\nMultiple distributions can be averaged using Akaike Information Criteria.\nConfidence intervals on hazard concentrations and proportions are produced by bootstrapping.\n\n`ssdtools` can handle censored data with two limitations.\nIt 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.\n\n## Introduction\n\nThe dependency [`ssddata`](https://github.com/open-AIMS/ssddata) provides example data sets for several chemicals including Boron.\nThe [ECOTOX](https://cfpub.epa.gov/ecotox/) Knowledgebase is another source of toxicity concentrations for over 12,000 chemicals.\n\n```{r, message=FALSE}\nlibrary(ssdtools)\nssddata::ccme_boron\n```\n\nThe six default distributions are fit using `ssd_fit_dists()`\n\n```{r}\nfits \u003c- ssd_fit_dists(ssddata::ccme_boron)\n```\n\nand can be quickly plotted using `autoplot`\n\n```{r, warning = FALSE, message = FALSE, fig.alt=\"A plot of the data and fitted distributions\"}\nautoplot(fits)\n```\n\nThe goodness of fit can be assessed using `ssd_gof`\n\n```{r}\nssd_gof(fits, wt = TRUE)\n```\n\nand the model-averaged 5% hazard concentration estimated (with bootstrapping to get confidence intervals) using `ssd_hc`.\n\n```{r}\nwithr::with_seed(99, {\n  hc5 \u003c- ssd_hc(fits, ci = TRUE)\n})\nprint(hc5)\n```\n\nModel-averaged predictions complete with confidence intervals can also be estimated by parametric bootstrapping using the `stats` generic `predict`.\n\n```{r, eval=FALSE}\nboron_pred \u003c- predict(fits, ci = TRUE)\n```\n\nThe predictions can be plotted together with the original data using `ssd_plot`.\n\n```{r, fig.alt=\"A plot of the data and model-averaged prediction with confidence intervals\"}\nlibrary(ggplot2)\n\ntheme_set(theme_bw())\n\nssd_plot(ssddata::ccme_boron, boron_pred,\n  shape = \"Group\", color = \"Group\", label = \"Species\",\n  xlab = \"Concentration (mg/L)\", ribbon = TRUE\n) +\n  expand_limits(x = 3000) +\n  scale_colour_ssd()\n```\n\n## Information\n\nGet started with ssdtools at \u003chttps://bcgov.github.io/ssdtools/articles/ssdtools.html\u003e.\n\nA shiny app to allow non-R users to interface with ssdtools is available at \u003chttps://github.com/bcgov/shinyssdtools\u003e.\n\nFor the latest changes to the development version see the [NEWS](https://bcgov.github.io/ssdtools/news/) file.\n\nFor recent developments in SSD modeling including a review of existing software see:\n\n*Fox, D.R., et al. 2021. Recent Developments in Species Sensitivity Distribution Modeling. Environ Toxicol Chem 40(2): 293–308. \u003chttps://doi.org/10.1002/etc.4925\u003e.*\n\n## Citation\n\n```{r, comment = \"\", echo = FALSE}\ncitation(\"ssdtools\")\n```\n\n## Installation\n\n### Release\n\nTo install the latest release version from [CRAN](https://CRAN.R-project.org/package=ssdtools).\n```r\ninstall.packages(\"ssdtools\")\n```\n\nThe website for the release version is at \u003chttps://bcgov.github.io/ssdtools/\u003e.\n\n### Development\n\nTo install the development version from [GitHub](https://github.com/bcgov/ssdtools)\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"bcgov/ssdtools\")\n```\n\nor from [r-universe](https://bcgov.r-universe.dev/ssdtools).\n```r\ninstall.packages(\"ssdtools\", repos = c(\"https://bcgov.r-universe.dev\", \"https://cloud.r-project.org\"))\n```\n\nThe website for the development version is at \u003chttps://bcgov.github.io/ssdtools/dev/\u003e.\n\n### Getting Help or Reporting an Issue\n\nTo report bugs/issues/feature requests, please file an [issue](https://github.com/bcgov/ssdtools/issues/).\n\n### Contribution\n\nIf you would like to contribute to the package, please see our \n[CONTRIBUTING](https://github.com/bcgov/ssdtools/blob/master/.github/CONTRIBUTING.md) guidelines.\n\n### Code of Conduct\n\nPlease note that the ssdtools project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). \nBy contributing to this project, you agree to abide by its terms.\n\n## References\n\nPosthuma, L., Suter II, G.W., and Traas, T.P. 2001. Species Sensitivity Distributions in Ecotoxicology. CRC Press.\n\n\u003cdiv id=\"refs\"\u003e\u003c/div\u003e\n\n```{r, results = \"asis\", echo = FALSE}\ncat(ssdtools::ssd_licensing_md())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgov%2Fssdtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcgov%2Fssdtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgov%2Fssdtools/lists"}