Skip to content

Commit

Permalink
Merge pull request #453 from Enchufa2/nycflights
Browse files Browse the repository at this point in the history
- Avoid use of `stop()` in examples if packages are not installed (#453, @Enchufa2).
  • Loading branch information
krlmlr committed Aug 13, 2018
2 parents 1810b00 + 734f1e5 commit d2f90db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 2 additions & 4 deletions R/glimpse.R
Expand Up @@ -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")
}
Expand Down
9 changes: 4 additions & 5 deletions R/utils-format.r
Expand Up @@ -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

Expand Down

0 comments on commit d2f90db

Please sign in to comment.