From 36508b9d9d78e044925158da8afd4822daf033ac Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Oct 2024 14:02:53 +0200 Subject: [PATCH] fix example --- R/simulate_simpson.R | 2 +- man/simulate_simpson.Rd | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/R/simulate_simpson.R b/R/simulate_simpson.R index 112ab7dcd..8b8cd55fb 100644 --- a/R/simulate_simpson.R +++ b/R/simulate_simpson.R @@ -12,7 +12,7 @@ #' #' @return A dataset. #' -#' @examples +#' @examplesIf requireNamespace("MASS", quietly = TRUE) #' data <- simulate_simpson(n = 10, groups = 5, r = 0.5) #' #' if (require("ggplot2")) { diff --git a/man/simulate_simpson.Rd b/man/simulate_simpson.Rd index 5c5590e95..80cc62c2e 100644 --- a/man/simulate_simpson.Rd +++ b/man/simulate_simpson.Rd @@ -33,6 +33,7 @@ and statistics, in which a trend appears in several different groups of data but disappears or reverses when these groups are combined. } \examples{ +\dontshow{if (requireNamespace("MASS", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} data <- simulate_simpson(n = 10, groups = 5, r = 0.5) if (require("ggplot2")) { @@ -41,4 +42,5 @@ if (require("ggplot2")) { geom_smooth(aes(color = Group), method = "lm") + geom_smooth(method = "lm") } +\dontshow{\}) # examplesIf} }