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

[docs] Colummn type guessing #1117

Closed
raffaem opened this issue Aug 23, 2024 · 1 comment · Fixed by #1123
Closed

[docs] Colummn type guessing #1117

raffaem opened this issue Aug 23, 2024 · 1 comment · Fixed by #1123

Comments

@raffaem
Copy link

raffaem commented Aug 23, 2024

readxl::read_excel guesses column types based on the value of the first guess_max (an argument of the function) of its cells (reference)

This causes problems in importing when a numeric cell way down in my Excel file is silently converted into a boolean, without any warning of any sort.

This problem doesn't happen with openxlsx2.

Can you specify in the documentation how openxlsx2 guesses column types?

My understanding is that Excel only provides cell types, not column types.

I was reading the "convert input to guessed type" in the documentation but it doesn't say much about how it guesses.

@JanMarvin
Copy link
Owner

Hi @raffaem , we have a function guess_column_type() iirc. It tries to guess the column type based on all values in the character column. The types are based on our internal checks. Does the cell look like a bool, a number, or a date.
Is there any specific reason why you want documentation improved on this specific topic? After all the code is open and you can simply have a look. I might add a sentence to the wb_to_df() documentation, but that would be more on the general side of things.

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

Successfully merging a pull request may close this issue.

2 participants