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} }