diff --git a/NAMESPACE b/NAMESPACE index 39d0661f..728d379f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -75,6 +75,7 @@ export(ssd_data) export(ssd_dists) export(ssd_dists_all) export(ssd_dists_bcanz) +export(ssd_dists_shiny) export(ssd_eburrIII3) export(ssd_ecd) export(ssd_ecd_data) diff --git a/NEWS.md b/NEWS.md index bf6174e4..49d73802 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ # ssdtools 2.2.0 - Added `ssd_label_comma_hc()` function to label numbers with significant digits and comma and offset hazard concentration value if present in breaks. +- Added `ssd_dists_shiny()` to define distributions for use in shiny app. - For `plot_coord_scale()` function: - Added `x_limits = NULL` to allow setting of x-axis limits. - Added `hc_value = NULL` to pass hazard concentration value. diff --git a/R/dists.R b/R/dists.R index 6a842188..61d3b0b5 100644 --- a/R/dists.R +++ b/R/dists.R @@ -62,3 +62,18 @@ ssd_dists <- function(bcanz = NULL, tails = NULL, npars = 2:5) { ssd_dists_all <- function() { ssd_dists(bcanz = NULL, tails = NULL, npars = 2:5) } + +#' All Shiny Species Sensitivity Distributions +#' +#' Gets a character vector of the names of all the available distributions +#' in the shinyssdtools. +#' +#' @return A unique, sorted character vector of the distributions. +#' @family dists +#' @export +#' +#' @examples +#' ssd_dists_shiny() +ssd_dists_shiny <- function() { + ssd_dists(bcanz = NULL, tails = TRUE, npars = 2:5) +} diff --git a/_pkgdown.yml b/_pkgdown.yml index fbc1e100..488d184c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -24,6 +24,7 @@ reference: - ssd_dists - ssd_dists_all - ssd_dists_bcanz + - ssd_dists_shiny - title: Fit desc: Functions that fit distributions to data contents: diff --git a/man/dist_data.Rd b/man/dist_data.Rd index 1182fdd8..4618c72d 100644 --- a/man/dist_data.Rd +++ b/man/dist_data.Rd @@ -28,7 +28,8 @@ dist_data \seealso{ Other dists: \code{\link{ssd_dists}()}, -\code{\link{ssd_dists_all}()} +\code{\link{ssd_dists_all}()}, +\code{\link{ssd_dists_shiny}()} } \concept{dists} \keyword{datasets} diff --git a/man/ssd_dists.Rd b/man/ssd_dists.Rd index 260e48ea..cce22b49 100644 --- a/man/ssd_dists.Rd +++ b/man/ssd_dists.Rd @@ -28,6 +28,7 @@ ssd_dists(npars = 5) \seealso{ Other dists: \code{\link{dist_data}}, -\code{\link{ssd_dists_all}()} +\code{\link{ssd_dists_all}()}, +\code{\link{ssd_dists_shiny}()} } \concept{dists} diff --git a/man/ssd_dists_all.Rd b/man/ssd_dists_all.Rd index d1b5c3e6..40995c3e 100644 --- a/man/ssd_dists_all.Rd +++ b/man/ssd_dists_all.Rd @@ -18,6 +18,7 @@ ssd_dists_all() \seealso{ Other dists: \code{\link{dist_data}}, -\code{\link{ssd_dists}()} +\code{\link{ssd_dists}()}, +\code{\link{ssd_dists_shiny}()} } \concept{dists} diff --git a/man/ssd_dists_shiny.Rd b/man/ssd_dists_shiny.Rd new file mode 100644 index 00000000..08299920 --- /dev/null +++ b/man/ssd_dists_shiny.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dists.R +\name{ssd_dists_shiny} +\alias{ssd_dists_shiny} +\title{All Shiny Species Sensitivity Distributions} +\usage{ +ssd_dists_shiny() +} +\value{ +A unique, sorted character vector of the distributions. +} +\description{ +Gets a character vector of the names of all the available distributions +in the shinyssdtools. +} +\examples{ +ssd_dists_shiny() +} +\seealso{ +Other dists: +\code{\link{dist_data}}, +\code{\link{ssd_dists}()}, +\code{\link{ssd_dists_all}()} +} +\concept{dists} diff --git a/tests/testthat/test-dists.R b/tests/testthat/test-dists.R index 77eaf71b..25a8b693 100644 --- a/tests/testthat/test-dists.R +++ b/tests/testthat/test-dists.R @@ -25,6 +25,16 @@ test_that("dists all", { ) }) +test_that("dists shiny", { + expect_identical( + ssd_dists_shiny(), + c( + "burrIII3", "gamma", "gompertz", "lgumbel", "llogis", + "llogis_llogis", "lnorm", "lnorm_lnorm", "weibull" + ) + ) +}) + test_that("dists all", { expect_identical(ssd_dists(), ssd_dists_all()) })