From 534e764a976762e2cdba4e32808b7c9a6b6fbe30 Mon Sep 17 00:00:00 2001 From: nikosbosse Date: Thu, 7 Mar 2024 12:56:41 -0500 Subject: [PATCH 1/2] Update documentation of `log_shift()` --- R/convenience-functions.R | 4 ++-- man/log_shift.Rd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/convenience-functions.R b/R/convenience-functions.R index 11f0b15d4..a27842c49 100644 --- a/R/convenience-functions.R +++ b/R/convenience-functions.R @@ -179,7 +179,7 @@ transform_forecasts <- function(data, #' @param x vector of input values to be transformed #' @param offset number to add to the input value before taking the natural #' logarithm -#' @param base a positive or complex number: the base with respect to which +#' @param base a positive number: the base with respect to which #' logarithms are computed. Defaults to e = exp(1). #' @importFrom cli cli_abort cli_warn #' @return A numeric vector with transformed values @@ -207,7 +207,7 @@ log_shift <- function(x, offset = 0, base = exp(1)) { assert_numeric(x, min.len = 1) assert_number(offset) - assert_number(base) + ?assert_number(base, lower = 0) if (any(x < 0, na.rm = TRUE)) { #nolint start: keyword_quote_linter diff --git a/man/log_shift.Rd b/man/log_shift.Rd index a780cce8e..15fa62b1e 100644 --- a/man/log_shift.Rd +++ b/man/log_shift.Rd @@ -12,7 +12,7 @@ log_shift(x, offset = 0, base = exp(1)) \item{offset}{number to add to the input value before taking the natural logarithm} -\item{base}{a positive or complex number: the base with respect to which +\item{base}{a positive number: the base with respect to which logarithms are computed. Defaults to e = exp(1).} } \value{ From cce7dfce1e19d9ba445995da3b055e3cbdc49443 Mon Sep 17 00:00:00 2001 From: Nikos Bosse <37978797+nikosbosse@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:02:47 -0600 Subject: [PATCH 2/2] Update R/convenience-functions.R Co-authored-by: James Azam --- R/convenience-functions.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/convenience-functions.R b/R/convenience-functions.R index a27842c49..3d2ce1407 100644 --- a/R/convenience-functions.R +++ b/R/convenience-functions.R @@ -207,7 +207,7 @@ log_shift <- function(x, offset = 0, base = exp(1)) { assert_numeric(x, min.len = 1) assert_number(offset) - ?assert_number(base, lower = 0) + assert_number(base, lower = 0) if (any(x < 0, na.rm = TRUE)) { #nolint start: keyword_quote_linter