From 35f8e3e3b1682e67fec9c7e71d2ea94587876ba7 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 17 Sep 2026 11:23:39 +0000 Subject: [PATCH] Fix R CMD check WARNING from ifExistsElse deprecation example ifExistsElse() is deprecated in favor of get0(), but its own @examples called itself, triggering a deprecation warning during R CMD check. The workflow treats warnings as failures (error-on: "warning"), so this broke CI. Wrap the example in \dontrun{} so it documents usage without executing the deprecated call. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01E1a5jFs1rFR2uhDtLLp3EA --- R/Stringendo.R | 5 ++++- man/ifExistsElse.Rd | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/R/Stringendo.R b/R/Stringendo.R index 62575a2..f3b46ea 100644 --- a/R/Stringendo.R +++ b/R/Stringendo.R @@ -186,8 +186,11 @@ ifExistsAndTrue <- function(varname = "pi") { #' @param alternative Value to return if `varname` is not defined. #' @param v Logical indicating whether to print informative messages. Default is `FALSE`. #' -#' @examples ifExistsElse("pi") +#' @examples +#' \dontrun{ +#' ifExistsElse("pi") #' ifExistsElse("pi22") +#' } #' #' @export ifExistsElse <- function(varname, alternative = "define an alternative", v = FALSE) { diff --git a/man/ifExistsElse.Rd b/man/ifExistsElse.Rd index f10d23c..fcae831 100644 --- a/man/ifExistsElse.Rd +++ b/man/ifExistsElse.Rd @@ -18,7 +18,9 @@ Returns the value of \code{varname} when it exists; otherwise returns \code{alte When \code{v} is \code{TRUE}, a message is printed indicating whether the variable was found. } \examples{ +\dontrun{ ifExistsElse("pi") ifExistsElse("pi22") +} }