From 3f5c1158d9c2322b2901b564637c1c612188d8a9 Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Wed, 1 Dec 2021 10:27:44 +0100 Subject: [PATCH] Remove withr dependency as well --- DESCRIPTION | 1 - R/utils.R | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 12cd89cc..6d2d75b1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -102,7 +102,6 @@ Imports: tidyr (>= 1.0.0), tidyselect, vroom, - withr, xml2 Suggests: ggplot2, diff --git a/R/utils.R b/R/utils.R index 3ccf10e7..9fd7364d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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 @@ -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) ) ) }