diff --git a/DESCRIPTION b/DESCRIPTION index abb0c9c..be4c48b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: readODS Type: Package Title: Read and Write ODS Files -Version: 2.2.0.999 +Version: 2.2.0.9999 Authors@R: c(person("Gerrit-Jan", "Schutten", role = c("aut"), email = "phonixor@gmail.com"), person("Chung-hong", "Chan", role = c("aut", "cre"), email = "chainsawtiney@gmail.com", comment = c(ORCID = "0000-0002-6232-7530")), @@ -25,7 +25,7 @@ URL: https://docs.ropensci.org/readODS/, https://github.com/ropensci/readODS BugReports: https://github.com/ropensci/readODS/issues Imports: cellranger, - readr (>= 1.2.1), + minty, stringi, tibble, vctrs (>= 0.4.2), @@ -40,7 +40,8 @@ Suggests: covr, knitr, rmarkdown, - withr + withr, + readr (>= 1.2.1) License: GPL-3 RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) diff --git a/R/read_ods.R b/R/read_ods.R index 147bbe5..48759eb 100644 --- a/R/read_ods.R +++ b/R/read_ods.R @@ -139,22 +139,11 @@ return(data.frame()) } -.type_convert <- function(df, col_types = NULL, verbose = TRUE, na = c("", "NA"), trim_ws = TRUE) { - if (verbose) { - res <- readr::type_convert(df = df, col_types, na = na) - } else { - suppressMessages({ - res <- readr::type_convert(df = df, col_types, na = na, trim_ws = trim_ws) - }) - } - return(res) -} - .handle_col_types <- function(res, col_types, verbose, na, trim_ws) { if (isTRUE(is.na(col_types)) || nrow(res) == 0) { return(res) } - .type_convert(df = res, col_types = col_types, verbose = verbose, na = na, trim_ws = trim_ws) + minty::type_convert(df = res, col_types = col_types, verbose = verbose, na = na, trim_ws = trim_ws) } ## standardise `sheet` parameter as a number, i.e. sheet_index