diff --git a/R/estimate_contrasts.R b/R/estimate_contrasts.R index 4cf08b1d..b8d4749d 100644 --- a/R/estimate_contrasts.R +++ b/R/estimate_contrasts.R @@ -14,7 +14,8 @@ #' #' @inherit estimate_slopes details #' -#' @examplesIf require("emmeans", quietly = TRUE) +#' @examplesIf require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE) +#' \dontrun{ #' # Basic usage #' model <- lm(Sepal.Width ~ Species, data = iris) #' estimate_contrasts(model) @@ -44,8 +45,6 @@ #' estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris)) #' standardize(estimated) #' -#' @examplesIf require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE) -#' \dontrun{ #' # Other models (mixed, Bayesian, ...) #' data <- iris #' data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B") diff --git a/man/estimate_contrasts.Rd b/man/estimate_contrasts.Rd index a74bf273..873a483a 100644 --- a/man/estimate_contrasts.Rd +++ b/man/estimate_contrasts.Rd @@ -123,7 +123,8 @@ the effect of x averaged over all conditions, or instead within each condition (\code{using [estimate_slopes]}). } \examples{ -\dontshow{if (require("emmeans", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontrun{ # Basic usage model <- lm(Sepal.Width ~ Species, data = iris) estimate_contrasts(model) @@ -152,9 +153,7 @@ estimate_contrasts(model, by = "Petal.Width", length = 4) # Standardized differences estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris)) standardize(estimated) -\dontshow{\}) # examplesIf} -\dontshow{if (require("lme4", quietly = TRUE) && require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -\dontrun{ + # Other models (mixed, Bayesian, ...) data <- iris data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")