Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulate readxl::read_xlsx() #154

Open
2 of 4 tasks
chainsawriot opened this issue Aug 22, 2023 · 3 comments
Open
2 of 4 tasks

Emulate readxl::read_xlsx() #154

chainsawriot opened this issue Aug 22, 2023 · 3 comments

Comments

@chainsawriot
Copy link
Collaborator

chainsawriot commented Aug 22, 2023

These are the current arguments of readxl::read_xlsx() (v1.4.3)

read_xlsx(
  path,
  sheet = NULL,
  range = NULL,
  col_names = TRUE,
  col_types = NULL,
  na = "",
  trim_ws = TRUE,
  skip = 0,
  n_max = Inf,
  guess_max = min(1000, n_max),
  progress = readxl_progress(),
  .name_repair = "unique"
)

This is readODS::read_ods()

readODS/R/read_ods.R

Lines 274 to 286 in 38cefb8

read_ods <- function(path,
sheet = 1,
col_names = TRUE,
col_types = NULL,
na = "",
skip = 0,
formula_as_formula = FALSE,
range = NULL,
row_names = FALSE,
strings_as_factors = FALSE,
verbose = FALSE,
as_tibble = TRUE,
.name_repair = "unique") {

We have some more, but there are parameters we could potentially add:

  • trim_ws
  • n_max
  • guess_max
  • progress

Except progress, all of them look easy to add.

@chainsawriot chainsawriot changed the title Emulate readxl::read_xlsx Emulate readxl::read_xlsx() Aug 22, 2023
@pbrohan
Copy link
Contributor

pbrohan commented Aug 24, 2023

readr::type_convert sadly doesn't have a guess_max argument, and so we won't be able to add that either unless we rewrite the type guessing (which I am not recommending we do).

chainsawriot added a commit that referenced this issue Dec 29, 2023
@chainsawriot chainsawriot reopened this Jun 10, 2024
@chainsawriot
Copy link
Collaborator Author

Reopen this, because of gesistsa/minty#33

@chainsawriot
Copy link
Collaborator Author

minty 0.0.4 is on CRAN. So, guess_max is now possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants