From 1f26f5ec71d36658cfa1bf4731c53c4b51a2815a Mon Sep 17 00:00:00 2001 From: "Brian M. Schilder" <34280215+bschilder@users.noreply.github.com> Date: Sun, 10 Dec 2023 16:02:05 +0000 Subject: [PATCH] upgrade args2vars; update rworkflows; fix examples --- R/stop_early.R | 2 +- man/stop_early.Rd | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/stop_early.R b/R/stop_early.R index 876b024..563a1bd 100644 --- a/R/stop_early.R +++ b/R/stop_early.R @@ -6,7 +6,7 @@ #' @export #' @examples #' testfun <- function(...) {stop_early(); message("Completed function."); 1} -#' testfun() +#' if(interactive()) testfun() stop_early <- function(msg="Exiting function early.") { opt <- options(show.error.messages = FALSE) on.exit(options(opt)) diff --git a/man/stop_early.Rd b/man/stop_early.Rd index d58b91d..3928bbe 100644 --- a/man/stop_early.Rd +++ b/man/stop_early.Rd @@ -16,6 +16,6 @@ Null Stop a function early without an error. } \examples{ -testfun <- function(...) {stop_early(); message("Completed function.")} -testfun() +testfun <- function(...) {stop_early(); message("Completed function."); 1} +if(interactive()) testfun() }