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

col_types = 'text_as_shown' ? #737

Open
moodymudskipper opened this issue Sep 15, 2023 · 1 comment
Open

col_types = 'text_as_shown' ? #737

moodymudskipper opened this issue Sep 15, 2023 · 1 comment

Comments

@moodymudskipper
Copy link

This is related to #462 (closed)

I understand why it was closed but I'd like to make the case for a 'text_as_shown' option for column types.

In many cases what is shown in excel is not the truth, so we're better off taking the actual value rather than what is shown.

In my case I have on one hand a lookup table in R that I don't create, which contains a column with "66.67%" stored as text (this column can also store actual text), and a value to look up, and on the other hand an excel file with this "66.67%" value typed by the user, expecting it to work with the lookup.

This will be read by read_excel() as "0.6....67" if I read it as text, and in order to to the lookup I have to do some awkward data wrangling.

Granted, I realise the design is not great, but I'm not responsible for it and this will be easily simplified if I could specify "text_as_shown" as a value to col_types, it would also be explicit enough so that I don't believe users would import wrong data by mistake more than they would without this option.

@jennybc
Copy link
Member

jennybc commented Sep 15, 2023

Can you share an indicative .xlsx file? And what readxl can get vs. what you want.

I know you read #462, but I just want to emphasize that often what Excel shows is not actually present anywhere in the .xlsx file. Instead, what the user sees in a cell is created on-the-fly by the Excel application. So there's a real possibility that we (readxl) don't have access to what you want.

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

No branches or pull requests

2 participants