From cf713d826d2f6ea157f2cdf7773bc4bdfaf6b60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 22 Nov 2024 08:16:06 +0100 Subject: [PATCH 1/4] chore: Fix vignette building if tibble is missing --- vignettes/printing.Rmd | 1 + 1 file changed, 1 insertion(+) diff --git a/vignettes/printing.Rmd b/vignettes/printing.Rmd index b31b22f72..97c0bc675 100644 --- a/vignettes/printing.Rmd +++ b/vignettes/printing.Rmd @@ -10,6 +10,7 @@ vignette: > ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, + eval = rlang::is_installed("tibble"), comment = "#>" ) From 2bc93661d1033cc75f3c273e1a45961be79adcc7 Mon Sep 17 00:00:00 2001 From: krlmlr Date: Fri, 22 Nov 2024 07:18:46 +0000 Subject: [PATCH 2/4] chore: Auto-update from GitHub Actions Run: https://github.com/r-lib/pillar/actions/runs/11968173372 --- .github/dep-suggests-matrix.json | 1 - .github/versions-matrix.json | 1 - 2 files changed, 2 deletions(-) delete mode 100644 .github/dep-suggests-matrix.json delete mode 100644 .github/versions-matrix.json diff --git a/.github/dep-suggests-matrix.json b/.github/dep-suggests-matrix.json deleted file mode 100644 index 3cc98e25f..000000000 --- a/.github/dep-suggests-matrix.json +++ /dev/null @@ -1 +0,0 @@ -{"package":["bit64","DBI","debugme","DiagrammeR","dplyr","formattable","ggplot2","lubridate","nanotime","nycflights13","palmerpenguins","scales","stringi","units","vdiffr"]} diff --git a/.github/versions-matrix.json b/.github/versions-matrix.json deleted file mode 100644 index 5af4434a8..000000000 --- a/.github/versions-matrix.json +++ /dev/null @@ -1 +0,0 @@ -{"include":[{"os":"macos-latest","r":"4.4"},{"os":"macos-latest","r":"4.3"},{"os":"windows-latest","r":"devel"},{"os":"windows-latest","r":"4.4"},{"os":"windows-latest","r":"4.3"},{"os":"ubuntu-22.04","r":"devel","http-user-agent":"release"},{"os":"ubuntu-22.04","r":"4.4"},{"os":"ubuntu-22.04","r":"4.3"},{"os":"ubuntu-22.04","r":"4.2"},{"os":"ubuntu-22.04","r":"4.1"},{"os":"ubuntu-22.04","r":"4.0"},{"os":"ubuntu-22.04","r":"4.4","covr":"true","desc":"with covr"}]} From 75b4b3f42ea611ce41155b5d6258ca00a1463fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 22 Nov 2024 14:55:33 +0100 Subject: [PATCH 3/4] Skip --- tests/testthat/test-glimpse.R | 1 + tests/testthat/test-num.R | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/testthat/test-glimpse.R b/tests/testthat/test-glimpse.R index d21e201c7..5db0c2eb2 100644 --- a/tests/testthat/test-glimpse.R +++ b/tests/testthat/test-glimpse.R @@ -56,6 +56,7 @@ test_that("glimpse calls tbl_sum() (#550)", { }) test_that("output test for glimpse()", { + skip_if_not_installed("tibble") local_unknown_rows() expect_snapshot({ diff --git a/tests/testthat/test-num.R b/tests/testthat/test-num.R index dd207ad48..199f7b729 100644 --- a/tests/testthat/test-num.R +++ b/tests/testthat/test-num.R @@ -1,4 +1,6 @@ test_that("output test", { + skip_if_not_installed("tibble") + expect_snapshot({ tibble::tibble( x0 = num(9:11 * 100 + 0.5, sigfig = 3), From d9c5b5c1db2a15319256496243036e9a2a9ae199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 22 Nov 2024 17:49:38 +0100 Subject: [PATCH 4/4] Examples --- R/ctl_new_pillar.R | 2 +- R/ctl_new_pillar_list.R | 2 +- R/options.R | 2 +- R/pillar-package.R | 2 +- R/tbl-format-body.R | 2 +- R/tbl-format-footer.R | 2 +- R/tbl-format-header.R | 2 +- R/tbl-format-setup.R | 2 +- man/ctl_new_pillar.Rd | 2 +- man/ctl_new_pillar_list.Rd | 2 +- man/pillar-package.Rd | 2 ++ man/pillar_options.Rd | 3 ++- man/tbl_format_body.Rd | 2 +- man/tbl_format_footer.Rd | 2 +- man/tbl_format_header.Rd | 2 +- man/tbl_format_setup.Rd | 2 +- 16 files changed, 18 insertions(+), 15 deletions(-) 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} }