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