Skip to content

Commit

Permalink
Remove withr dependency as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Dec 1, 2021
1 parent 79857e9 commit 3f5c115
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ Imports:
tidyr (>= 1.0.0),
tidyselect,
vroom,
withr,
xml2
Suggests:
ggplot2,
Expand Down
12 changes: 4 additions & 8 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dplyr::`%>%`
#' @importFrom memoise memoise cache_filesystem
#' @importFrom vroom vroom
#' @importFrom dplyr tibble
#' @importFrom withr with_envvar
#' @concept utility
csv_reader <- function(file, verbose = FALSE, guess_max = 1000, ...) {
read_csv_fun <- vroom
Expand All @@ -26,14 +25,11 @@ csv_reader <- function(file, verbose = FALSE, guess_max = 1000, ...) {
}
if (verbose) {
message("Downloading data from ", file)
data <- read_csv_fun(file, ..., guess_max = guess_max)
data <- read_csv_fun(file, progress = TRUE, ..., guess_max = guess_max)
} else {
with_envvar(
new = c("VROOM_SHOW_PROGRESS" = "false"),
data <- suppressWarnings(
suppressMessages(
read_csv_fun(file, ..., guess_max = guess_max)
)
data <- suppressWarnings(
suppressMessages(
read_csv_fun(file, progress = FALSE, ..., guess_max = guess_max)
)
)
}
Expand Down

0 comments on commit 3f5c115

Please sign in to comment.