Skip to content

Commit 7289c7d

Browse files
authored
use minty ref #173 (#187)
* experiment with minty * minty is on CRAN
1 parent 8f0a330 commit 7289c7d

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

DESCRIPTION

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: readODS
22
Type: Package
33
Title: Read and Write ODS Files
4-
Version: 2.2.0.999
4+
Version: 2.2.0.9999
55
Authors@R:
66
c(person("Gerrit-Jan", "Schutten", role = c("aut"), email = "phonixor@gmail.com"),
77
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
2525
BugReports: https://github.com/ropensci/readODS/issues
2626
Imports:
2727
cellranger,
28-
readr (>= 1.2.1),
28+
minty,
2929
stringi,
3030
tibble,
3131
vctrs (>= 0.4.2),
@@ -40,7 +40,8 @@ Suggests:
4040
covr,
4141
knitr,
4242
rmarkdown,
43-
withr
43+
withr,
44+
readr (>= 1.2.1)
4445
License: GPL-3
4546
RoxygenNote: 7.2.3
4647
Roxygen: list(markdown = TRUE)

R/read_ods.R

+1-12
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,11 @@
139139
return(data.frame())
140140
}
141141

142-
.type_convert <- function(df, col_types = NULL, verbose = TRUE, na = c("", "NA"), trim_ws = TRUE) {
143-
if (verbose) {
144-
res <- readr::type_convert(df = df, col_types, na = na)
145-
} else {
146-
suppressMessages({
147-
res <- readr::type_convert(df = df, col_types, na = na, trim_ws = trim_ws)
148-
})
149-
}
150-
return(res)
151-
}
152-
153142
.handle_col_types <- function(res, col_types, verbose, na, trim_ws) {
154143
if (isTRUE(is.na(col_types)) || nrow(res) == 0) {
155144
return(res)
156145
}
157-
.type_convert(df = res, col_types = col_types, verbose = verbose, na = na, trim_ws = trim_ws)
146+
minty::type_convert(df = res, col_types = col_types, verbose = verbose, na = na, trim_ws = trim_ws)
158147
}
159148

160149
## standardise `sheet` parameter as a number, i.e. sheet_index

0 commit comments

Comments
 (0)