From f1d948f50741c04532b64065ccdac27aa2a04cef Mon Sep 17 00:00:00 2001 From: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> Date: Tue, 28 Jul 2026 07:38:31 +0000 Subject: [PATCH 1/3] Polish package metadata for CRAN Co-authored-by: sbfnk --- DESCRIPTION | 6 ++++-- R/dist_spec.R | 16 ---------------- inst/WORDLIST | 7 +++++++ man/distspec-package.Rd | 7 ++++++- man/extract_single_dist.Rd | 17 ----------------- 5 files changed, 17 insertions(+), 36 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4ae1c24..9e8e905 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Type: Package Package: distspec -Title: Define Probability Distributions with Certain or Uncertain Parameters +Title: Probability Distributions with Certain or Uncertain Parameters Version: 0.1.0 Authors@R: c(person(given = "Sebastian", @@ -17,7 +17,9 @@ Authors@R: family = "Abbott", role = c("aut"), email = "sam.abbott@lshtm.ac.uk", - comment = c(ORCID = "0000-0001-8057-8037")) + comment = c(ORCID = "0000-0001-8057-8037")), + person(given = "EpiForecasts", + role = "cph") ) Description: Represents probability distributions with fixed or potentially uncertain parameters, with tools to discretise, convolve, sample from and diff --git a/R/dist_spec.R b/R/dist_spec.R index 6b54057..efeb86d 100644 --- a/R/dist_spec.R +++ b/R/dist_spec.R @@ -672,22 +672,6 @@ plot.dist_spec <- function(x, samples = 50L, res = 1, cumulative = TRUE, ...) { #' @importFrom cli cli_abort #' @return A single `dist_spec` object #' @keywords internal -#' @examples -#' dist1 <- LogNormal(mean = 1.6, sd = 0.5, max = 20) -#' -#' # An uncertain gamma distribution with shape and rate normally distributed -#' # as Normal(3, 0.5) and Normal(2, 0.5) respectively -#' dist2 <- Gamma( -#' shape = Normal(3, 0.5), -#' rate = Normal(2, 0.5), -#' max = 20 -#' ) -#' -#' # Multiple distributions -#' \dontrun{ -#' dist <- dist1 + dist2 -#' extract_single_dist(dist, 2) -#' } extract_single_dist <- function(x, i) { if (i > ndist(x)) { cli_abort( diff --git a/inst/WORDLIST b/inst/WORDLIST index 71debe6..d7e7476 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,26 +1,32 @@ CMD +CensoredDistributions Charniga Codecov +ComposedDistributions Dirichlet Discretisation Discretise Discretised Discretising EpiNow +Lifecycle ORCID PMF PMFs +Un cleanups cutoff dependabot discretisation discretise discretised +discretises dist erroring etc github jamesmbaazam +jl medRxiv nonzero pmf @@ -29,3 +35,4 @@ roxygen sbfnk sd seabbs +th diff --git a/man/distspec-package.Rd b/man/distspec-package.Rd index 3a5fa99..651ab6b 100644 --- a/man/distspec-package.Rd +++ b/man/distspec-package.Rd @@ -4,7 +4,7 @@ \name{distspec-package} \alias{distspec} \alias{distspec-package} -\title{distspec: Define Probability Distributions with Certain or Uncertain Parameters} +\title{distspec: Probability Distributions with Certain or Uncertain Parameters} \description{ Represents probability distributions with fixed or potentially uncertain parameters, with tools to discretise, convolve, sample from and summarise them. } @@ -25,5 +25,10 @@ Authors: \item Sam Abbott \email{sam.abbott@lshtm.ac.uk} (\href{https://orcid.org/0000-0001-8057-8037}{ORCID}) } +Other contributors: +\itemize{ + \item EpiForecasts [copyright holder] +} + } \keyword{internal} diff --git a/man/extract_single_dist.Rd b/man/extract_single_dist.Rd index 7b883ca..79c1077 100644 --- a/man/extract_single_dist.Rd +++ b/man/extract_single_dist.Rd @@ -17,21 +17,4 @@ A single \code{dist_spec} object \description{ Extract a single element of a composite \verb{} } -\examples{ -dist1 <- LogNormal(mean = 1.6, sd = 0.5, max = 20) - -# An uncertain gamma distribution with shape and rate normally distributed -# as Normal(3, 0.5) and Normal(2, 0.5) respectively -dist2 <- Gamma( - shape = Normal(3, 0.5), - rate = Normal(2, 0.5), - max = 20 -) - -# Multiple distributions -\dontrun{ -dist <- dist1 + dist2 -extract_single_dist(dist, 2) -} -} \keyword{internal} From 331dc26ed0cc81a684a4ff6664ff19c331b426bb Mon Sep 17 00:00:00 2001 From: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> Date: Tue, 28 Jul 2026 07:43:48 +0000 Subject: [PATCH 2/3] Guard the plot example on ggplot2 and return invisibly from print Co-authored-by: sbfnk --- R/dist_spec.R | 3 ++- man/plot.dist_spec.Rd | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/R/dist_spec.R b/R/dist_spec.R index efeb86d..860a6ba 100644 --- a/R/dist_spec.R +++ b/R/dist_spec.R @@ -457,6 +457,7 @@ max.multi_dist_spec <- function(x, ...) { #' print(dist2) print.dist_spec <- function(x, ...) { print_dist_spec_indented(x, indent = 0, ...) + invisible(x) } #' @keywords internal print_dist_spec_indented <- function(x, indent, ...) { @@ -553,7 +554,7 @@ print_dist_spec_indented <- function(x, indent, ...) { #' @importFrom rlang .data `%||%` #' @importFrom cli cli_abort cli_warn #' @export -#' @examples +#' @examplesIf rlang::is_installed("ggplot2") #' # A fixed lognormal distribution with mean 5 and sd 1. #' dist1 <- LogNormal(mean = 1.6, sd = 0.5, max = 20) #' # Plot discretised distribution with 1 day discretisation window diff --git a/man/plot.dist_spec.Rd b/man/plot.dist_spec.Rd index 53d66d9..d295de4 100644 --- a/man/plot.dist_spec.Rd +++ b/man/plot.dist_spec.Rd @@ -36,6 +36,7 @@ and no \code{cdf_cutoff} of its own raises an error; bound it first (e.g. with \code{\link[=bound_dist]{bound_dist()}}). } \examples{ +\dontshow{if (rlang::is_installed("ggplot2")) withAutoprint(\{ # examplesIf} # A fixed lognormal distribution with mean 5 and sd 1. dist1 <- LogNormal(mean = 1.6, sd = 0.5, max = 20) # Plot discretised distribution with 1 day discretisation window @@ -55,4 +56,5 @@ plot(dist2) # Multiple distributions with 0.1 discretisation window and do not plot the # cumulative distribution plot(dist1 + dist2, res = 0.1, cumulative = FALSE) +\dontshow{\}) # examplesIf} } From fef8186da453ea7224b569c739a10f91e87064c7 Mon Sep 17 00:00:00 2001 From: sbfnk-bot <242615673+sbfnk-bot@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:21:07 +0000 Subject: [PATCH 3/3] Drop EpiForecasts copyright holder from author list --- DESCRIPTION | 4 +--- man/distspec-package.Rd | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9e8e905..8f2e37a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,9 +17,7 @@ Authors@R: family = "Abbott", role = c("aut"), email = "sam.abbott@lshtm.ac.uk", - comment = c(ORCID = "0000-0001-8057-8037")), - person(given = "EpiForecasts", - role = "cph") + comment = c(ORCID = "0000-0001-8057-8037")) ) Description: Represents probability distributions with fixed or potentially uncertain parameters, with tools to discretise, convolve, sample from and diff --git a/man/distspec-package.Rd b/man/distspec-package.Rd index 651ab6b..6de8d44 100644 --- a/man/distspec-package.Rd +++ b/man/distspec-package.Rd @@ -25,10 +25,5 @@ Authors: \item Sam Abbott \email{sam.abbott@lshtm.ac.uk} (\href{https://orcid.org/0000-0001-8057-8037}{ORCID}) } -Other contributors: -\itemize{ - \item EpiForecasts [copyright holder] -} - } \keyword{internal}