From 734f1e59da7724ecf8e1bfe8a2cc3d63d068edb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20=C3=9Acar?= Date: Mon, 13 Aug 2018 21:30:55 +0200 Subject: [PATCH] fix examples with suggested packages --- R/glimpse.R | 6 ++---- R/utils-format.r | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/R/glimpse.R b/R/glimpse.R index cbdae8118..d42c6738c 100644 --- a/R/glimpse.R +++ b/R/glimpse.R @@ -20,10 +20,8 @@ #' @examples #' glimpse(mtcars) #' -#' if (!requireNamespace("nycflights13", quietly = TRUE)) -#' stop("Please install the nycflights13 package to run the rest of this example") -#' -#' glimpse(nycflights13::flights) +#' if (requireNamespace("nycflights13", quietly = TRUE)) +#' glimpse(nycflights13::flights) glimpse <- function(x, width = NULL, ...) { UseMethod("glimpse") } diff --git a/R/utils-format.r b/R/utils-format.r index e6519f072..6f32d4d51 100644 --- a/R/utils-format.r +++ b/R/utils-format.r @@ -23,11 +23,10 @@ #' print(as_tibble(mtcars), n = 3) #' print(as_tibble(mtcars), n = 100) #' -#' if (!requireNamespace("nycflights13", quietly = TRUE)) -#' stop("Please install the nycflights13 package to run the rest of this example") -#' -#' print(nycflights13::flights, n_extra = 2) -#' print(nycflights13::flights, width = Inf) +#' if (requireNamespace("nycflights13", quietly = TRUE)) { +#' print(nycflights13::flights, n_extra = 2) +#' print(nycflights13::flights, width = Inf) +#' } #' @name formatting NULL