diff --git a/R/data_plot.R b/R/data_plot.R index eb4a8e9ff..9afa86843 100644 --- a/R/data_plot.R +++ b/R/data_plot.R @@ -97,8 +97,8 @@ data_plot <- function(x, ...) { #' information to the plot. #' #' @inheritParams data_plot -#' @examples -#' \dontrun{ +#' @examplesIf require("rstanarm", quietly = TRUE) +#' \donttest{ #' library(rstanarm) #' library(bayestestR) #' library(see) diff --git a/R/plot.parameters_brms_meta.R b/R/plot.parameters_brms_meta.R index 6f1c15f4f..7638c9e39 100644 --- a/R/plot.parameters_brms_meta.R +++ b/R/plot.parameters_brms_meta.R @@ -107,7 +107,7 @@ data_plot.parameters_brms_meta <- function(x, data = NULL, normalize_height = TR #' } #' #' @examplesIf require("brms") && require("metafor") -#' \dontrun{ +#' \donttest{ #' library(parameters) #' library(brms) #' library(metafor) diff --git a/R/plots.R b/R/plots.R index f5953a604..ea52794db 100644 --- a/R/plots.R +++ b/R/plots.R @@ -1,7 +1,9 @@ #' Multiple plots side by side #' #' A wrapper around *patchwork* to plot multiple figures side by side on -#' the same page. See [the *patchwork* documentation](https://patchwork.data-imaginist.com/articles/patchwork.html) +#' the same page. +#' +#' See [the *patchwork* documentation](https://patchwork.data-imaginist.com/articles/patchwork.html) #' for more advanced control of plot layouts. #' #' @param ... Multiple `ggplot`s or a list containing `ggplot` objects @@ -29,7 +31,8 @@ #' @param theme A ggplot theme specification to use for the plot. Only elements #' related to titles, caption, and tags, as well as plot margin and #' background, are used. -#' @examplesIf requireNamespace("patchwork", quietly = TRUE) +#' +#' @examplesIf require("patchwork", quietly = TRUE) #' library(ggplot2) #' library(see) #' diff --git a/man/add_plot_attributes.Rd b/man/add_plot_attributes.Rd index 1c6693ed9..9eea79a83 100644 --- a/man/add_plot_attributes.Rd +++ b/man/add_plot_attributes.Rd @@ -15,7 +15,8 @@ labels, etc.) as attributes, while \code{add_plot_attributes()} adds this information to the plot. } \examples{ -\dontrun{ +\dontshow{if (require("rstanarm", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\donttest{ library(rstanarm) library(bayestestR) library(see) @@ -39,4 +40,5 @@ p <- ggplot( p p + add_plot_attributes(data) } +\dontshow{\}) # examplesIf} } diff --git a/man/plot.see_parameters_brms_meta.Rd b/man/plot.see_parameters_brms_meta.Rd index 7add95b5b..31690583a 100644 --- a/man/plot.see_parameters_brms_meta.Rd +++ b/man/plot.see_parameters_brms_meta.Rd @@ -62,7 +62,7 @@ output of estimates and credible intervals. } \examples{ \dontshow{if (require("brms") && require("metafor")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} -\dontrun{ +\donttest{ library(parameters) library(brms) library(metafor) diff --git a/man/plots.Rd b/man/plots.Rd index 1ea1fb011..13b82539b 100644 --- a/man/plots.Rd +++ b/man/plots.Rd @@ -56,11 +56,14 @@ background, are used.} } \description{ A wrapper around \emph{patchwork} to plot multiple figures side by side on -the same page. See \href{https://patchwork.data-imaginist.com/articles/patchwork.html}{the \emph{patchwork} documentation} +the same page. +} +\details{ +See \href{https://patchwork.data-imaginist.com/articles/patchwork.html}{the \emph{patchwork} documentation} for more advanced control of plot layouts. } \examples{ -\dontshow{if (requireNamespace("patchwork", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (require("patchwork", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} library(ggplot2) library(see)