diff --git a/R/ctl_new_pillar.R b/R/ctl_new_pillar.R index 2187082d1..d717ae9fd 100644 --- a/R/ctl_new_pillar.R +++ b/R/ctl_new_pillar.R @@ -36,7 +36,7 @@ #' packed data frames, matrices, or arrays. #' #' @export -#' @examplesIf rlang::is_installed("palmerpenguins") && requireNamespace("tibble") +#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) #' # Create pillar objects #' ctl_new_pillar( #' palmerpenguins::penguins, diff --git a/R/ctl_new_pillar_list.R b/R/ctl_new_pillar_list.R index cc933626e..2f67228ad 100644 --- a/R/ctl_new_pillar_list.R +++ b/R/ctl_new_pillar_list.R @@ -42,7 +42,7 @@ #' for a compound pillar (or the pillar itself for a simple pillar) #' has been constructed already. #' @export -#' @examplesIf rlang::is_installed("palmerpenguins") && requireNamespace("tibble") +#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) && requireNamespace("tibble") #' # Simple column #' ctl_new_pillar_list( #' tibble::tibble(), diff --git a/R/options.R b/R/options.R index 053709d7b..43e2fc4ff 100644 --- a/R/options.R +++ b/R/options.R @@ -7,7 +7,7 @@ #' @usage NULL #' @format NULL #' -#' @examples +#' @examplesIf rlang::is_installed("tibble") #' df <- tibble::tibble(x = c(1.234567, NA, 5:10)) #' df #' diff --git a/R/pillar-package.R b/R/pillar-package.R index a40eac5b2..58e10ed07 100644 --- a/R/pillar-package.R +++ b/R/pillar-package.R @@ -12,7 +12,7 @@ #' - [print.tbl()] for formatting data-frame-like objects, #' - [pillar_options] for a list of package options. #' -#' @examples +#' @examplesIf rlang::is_installed("tibble") #' pillar(1:3) #' pillar(c(1, 2, 3)) #' pillar(factor(letters[1:3]), title = "letters") diff --git a/R/tbl-format-body.R b/R/tbl-format-body.R index 53b9fc312..988cff4e6 100644 --- a/R/tbl-format-body.R +++ b/R/tbl-format-body.R @@ -21,7 +21,7 @@ #' A character vector. #' #' @export -#' @examplesIf rlang::is_installed("palmerpenguins") +#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) #' setup <- tbl_format_setup(palmerpenguins::penguins) #' tbl_format_body(palmerpenguins::penguins, setup) #' diff --git a/R/tbl-format-footer.R b/R/tbl-format-footer.R index cfa088165..c58a4362b 100644 --- a/R/tbl-format-footer.R +++ b/R/tbl-format-footer.R @@ -17,7 +17,7 @@ #' @inherit tbl_format_body return #' #' @export -#' @examplesIf rlang::is_installed("palmerpenguins") +#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) #' setup <- tbl_format_setup(palmerpenguins::penguins) #' tbl_format_footer(palmerpenguins::penguins, setup) #' diff --git a/R/tbl-format-header.R b/R/tbl-format-header.R index 745c2d593..638f19ec5 100644 --- a/R/tbl-format-header.R +++ b/R/tbl-format-header.R @@ -18,7 +18,7 @@ #' @inherit tbl_format_body return #' #' @export -#' @examplesIf rlang::is_installed("palmerpenguins") +#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) #' setup <- tbl_format_setup(palmerpenguins::penguins) #' tbl_format_header(palmerpenguins::penguins, setup) #' diff --git a/R/tbl-format-setup.R b/R/tbl-format-setup.R index 6038e19b2..5244540cf 100644 --- a/R/tbl-format-setup.R +++ b/R/tbl-format-setup.R @@ -61,7 +61,7 @@ #' An object that can be passed as `setup` argument to #' [tbl_format_header()], [tbl_format_body()], and [tbl_format_footer()]. #' @export -#' @examplesIf rlang::is_installed("palmerpenguins") +#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) #' tbl_format_setup(palmerpenguins::penguins) tbl_format_setup <- function(x, width = NULL, ..., n = NULL, max_extra_cols = NULL, diff --git a/man/ctl_new_pillar.Rd b/man/ctl_new_pillar.Rd index f4c27d33b..f6080e2e6 100644 --- a/man/ctl_new_pillar.Rd +++ b/man/ctl_new_pillar.Rd @@ -49,7 +49,7 @@ Implementations should return \code{NULL} if none of the data fits the available width. } \examples{ -\dontshow{if (rlang::is_installed("palmerpenguins") && requireNamespace("tibble")) withAutoprint(\{ # examplesIf} +\dontshow{if (rlang::is_installed(c("palmerpenguins", "tibble"))) withAutoprint(\{ # examplesIf} # Create pillar objects ctl_new_pillar( palmerpenguins::penguins, diff --git a/man/ctl_new_pillar_list.Rd b/man/ctl_new_pillar_list.Rd index bfa947db3..3662fd805 100644 --- a/man/ctl_new_pillar_list.Rd +++ b/man/ctl_new_pillar_list.Rd @@ -65,7 +65,7 @@ and with \code{first_pillar} set to the pillar object constructed in the first call. } \examples{ -\dontshow{if (rlang::is_installed("palmerpenguins") && requireNamespace("tibble")) withAutoprint(\{ # examplesIf} +\dontshow{if (rlang::is_installed(c("palmerpenguins", "tibble")) && requireNamespace("tibble")) withAutoprint(\{ # examplesIf} # Simple column ctl_new_pillar_list( tibble::tibble(), diff --git a/man/pillar-package.Rd b/man/pillar-package.Rd index 33cf7b225..602d969af 100644 --- a/man/pillar-package.Rd +++ b/man/pillar-package.Rd @@ -12,10 +12,12 @@ using the full range of colours provided by modern terminals. Provides various generics for making every aspect of the display customizable. } \examples{ +\dontshow{if (rlang::is_installed("tibble")) withAutoprint(\{ # examplesIf} pillar(1:3) pillar(c(1, 2, 3)) pillar(factor(letters[1:3]), title = "letters") tbl_format_setup(tibble::as_tibble(mtcars), width = 60) +\dontshow{\}) # examplesIf} } \seealso{ \itemize{ diff --git a/man/pillar_options.Rd b/man/pillar_options.Rd index d044321b4..608e4bfa4 100644 --- a/man/pillar_options.Rd +++ b/man/pillar_options.Rd @@ -75,6 +75,7 @@ and to \code{FALSE} otherwise. } \examples{ +\dontshow{if (rlang::is_installed("tibble")) withAutoprint(\{ # examplesIf} df <- tibble::tibble(x = c(1.234567, NA, 5:10)) df @@ -90,6 +91,6 @@ df # Change back to the original value: options(old) df - +\dontshow{\}) # examplesIf} } \keyword{datasets} diff --git a/man/tbl_format_body.Rd b/man/tbl_format_body.Rd index c5f890482..27938ff35 100644 --- a/man/tbl_format_body.Rd +++ b/man/tbl_format_body.Rd @@ -30,7 +30,7 @@ If you only need to change the appearance of a single data type, override \code{\link[vctrs:vec_ptype_full]{vctrs::vec_ptype_abbr()}} and \code{\link[=pillar_shaft]{pillar_shaft()}} for this data type. } \examples{ -\dontshow{if (rlang::is_installed("palmerpenguins")) withAutoprint(\{ # examplesIf} +\dontshow{if (rlang::is_installed(c("palmerpenguins", "tibble"))) withAutoprint(\{ # examplesIf} setup <- tbl_format_setup(palmerpenguins::penguins) tbl_format_body(palmerpenguins::penguins, setup) diff --git a/man/tbl_format_footer.Rd b/man/tbl_format_footer.Rd index 51d1e9263..330580602 100644 --- a/man/tbl_format_footer.Rd +++ b/man/tbl_format_footer.Rd @@ -30,7 +30,7 @@ The default implementation adds information about rows and columns that are not shown in the body. } \examples{ -\dontshow{if (rlang::is_installed("palmerpenguins")) withAutoprint(\{ # examplesIf} +\dontshow{if (rlang::is_installed(c("palmerpenguins", "tibble"))) withAutoprint(\{ # examplesIf} setup <- tbl_format_setup(palmerpenguins::penguins) tbl_format_footer(palmerpenguins::penguins, setup) diff --git a/man/tbl_format_header.Rd b/man/tbl_format_header.Rd index 43fcf2b19..8fecd3818 100644 --- a/man/tbl_format_header.Rd +++ b/man/tbl_format_header.Rd @@ -31,7 +31,7 @@ override or extend \code{\link[=tbl_sum]{tbl_sum()}} for your class which is cal default method. } \examples{ -\dontshow{if (rlang::is_installed("palmerpenguins")) withAutoprint(\{ # examplesIf} +\dontshow{if (rlang::is_installed(c("palmerpenguins", "tibble"))) withAutoprint(\{ # examplesIf} setup <- tbl_format_setup(palmerpenguins::penguins) tbl_format_header(palmerpenguins::penguins, setup) diff --git a/man/tbl_format_setup.Rd b/man/tbl_format_setup.Rd index 2af0f4f3b..f71551442 100644 --- a/man/tbl_format_setup.Rd +++ b/man/tbl_format_setup.Rd @@ -86,7 +86,7 @@ standard printing for tibbles. See \code{\link[=new_tbl_format_setup]{new_tbl_format_setup()}} for details on the returned object. } \examples{ -\dontshow{if (rlang::is_installed("palmerpenguins")) withAutoprint(\{ # examplesIf} +\dontshow{if (rlang::is_installed(c("palmerpenguins", "tibble"))) withAutoprint(\{ # examplesIf} tbl_format_setup(palmerpenguins::penguins) \dontshow{\}) # examplesIf} }