From b5a8ae9f5011d56515a9815d53b4030e02e53f7a Mon Sep 17 00:00:00 2001 From: "long.nguyen" Date: Wed, 9 Feb 2022 13:56:24 +0100 Subject: [PATCH 1/2] Support other delimiters --- dplyr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dplyr b/dplyr index ef94e79..aea0742 100755 --- a/dplyr +++ b/dplyr @@ -56,7 +56,7 @@ read_data <- function(input) { ext <- tolower(tools::file_ext(input)) switch( ext, - csv = readr::read_csv(input, col_types = readr::cols()), + csv = readr::read_delim(input, col_types = readr::cols()), rds = readRDS(input), stop("Unknown file extension: ", ext) ) @@ -93,7 +93,7 @@ if (length(input) == 1) { .data <- read_data(input) } else { if (opt$verbose) message("[input] reading CSV from stdin") - .data <- readr::read_csv(I(input), col_types = readr::cols()) + .data <- readr::read_delim(I(input), col_types = readr::cols()) } From 3f876e9b4e07f41333251497db9982afabd85f77 Mon Sep 17 00:00:00 2001 From: "long.nguyen" Date: Wed, 9 Feb 2022 14:09:04 +0100 Subject: [PATCH 2/2] Delimiter guessing requires readr >= 2.0.0 --- dplyr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dplyr b/dplyr index aea0742..4b6ced1 100755 --- a/dplyr +++ b/dplyr @@ -23,7 +23,7 @@ suppressMessages({ library(dplyr) }) - +stopifnot(utils::packageVersion("readr") >= "2.0.0") #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # configuration for docopt