You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider an abbreviated account of "New names" #406
I've switched to tibble::set_tidy_names() now in the dev version of readxl. And frequently readxl::read_excel() does a lot of name repair. Especially before you really dial in the range or skip values that isolate the data rectangle. I'm beginning to wonder if the messaging around new names should have some upper limit, after which you get a summary. Below is a very modest example. It can get much worse.
Agreed, in particular for duplicate names we should (also) print the index.
According to the tidyverse style guide, we should only print the first five entries with an ellipsis.
Will the "rename info" object be available as an attribute in the returned tibble? This object could contain the full set of operations, and print all of them with e.g. print(..., n = Inf).
Agreed, in particular for duplicate names we should (also) print the index.
FWIW the index is recoverable from the repaired name, if I follow you.
Will the "rename info" object be available as an attribute in the returned tibble? This object could contain the full set of operations, and print all of them with e.g. print(..., n = Inf).
I had not thought about this, but perhaps it is a good idea. I don't have a strong opinion. It would be a 2-column tibble with var names "before" and "after" repair?
This would get my vote for sure. I've seen people request a Ctrl+z for R transformations before, which makes me think a before and after could be useful.
It's true that I have already had people who want to apply their own name repair logic in readxl, which isn't really possible. But this attribute would allow them to do this post hoc. I think it should be a full tibble of "before" vs. "after" var names, if it exists, i.e. not just the ones that were repaired.
I wonder if we should return a tibble with "broken" column names and provide repair_broken() and ignore_broken() functions that applies or discards the transformations that were guessed. We wouldn't need an undo, and the broken tibble shows instructions about how to fix it when printed.
The new column renaming change in RSQLite causes trouble: r-dbi/RSQLite#259.
For now, I'd suggest that readxl and friends use tidy_names() and apply the renaming manually, if the rename info needs to be returned to the client. I have updated the documentation to include this pattern.
To make the rename information available to callers, call tidy_names() and assign the result via names() or rlang::set_names().
but that doesn't seem to address how we're going to return the rename info. Feels like we should take a position on this: in an attribute? if so, with what name? 2-colum tibble or named vector?
Do you have an opinion? If not, I can think/experiment and make a proposal.
Like in #458, this could be the responsibility of a different package. I'd rather not add this to tibble for now, but e.g. readxl could suggest an implementation which we then adopt. Would that work?
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.
Activity
krlmlr commentedon Jun 6, 2018
Agreed, in particular for duplicate names we should (also) print the index.
According to the tidyverse style guide, we should only print the first five entries with an ellipsis.
Will the "rename info" object be available as an attribute in the returned tibble? This object could contain the full set of operations, and print all of them with e.g.
print(..., n = Inf).jennybc commentedon Jun 6, 2018
FWIW the index is recoverable from the repaired name, if I follow you.
I had not thought about this, but perhaps it is a good idea. I don't have a strong opinion. It would be a 2-column tibble with var names "before" and "after" repair?
batpigandme commentedon Jun 6, 2018
This would get my vote for sure. I've seen people request a Ctrl+z for R transformations before, which makes me think a before and after could be useful.
jennybc commentedon Jun 6, 2018
It's true that I have already had people who want to apply their own name repair logic in readxl, which isn't really possible. But this attribute would allow them to do this post hoc. I think it should be a full tibble of "before" vs. "after" var names, if it exists, i.e. not just the ones that were repaired.
krlmlr commentedon Jun 6, 2018
I wonder if we should return a tibble with "broken" column names and provide
repair_broken()andignore_broken()functions that applies or discards the transformations that were guessed. We wouldn't need an undo, and the broken tibble shows instructions about how to fix it when printed.The new column renaming change in RSQLite causes trouble: r-dbi/RSQLite#259.
krlmlr commentedon Aug 20, 2018
For now, I'd suggest that readxl and friends use
tidy_names()and apply the renaming manually, if the rename info needs to be returned to the client. I have updated the documentation to include this pattern.jennybc commentedon Aug 21, 2018
I see this:
but that doesn't seem to address how we're going to return the rename info. Feels like we should take a position on this: in an attribute? if so, with what name? 2-colum tibble or named vector?
Do you have an opinion? If not, I can think/experiment and make a proposal.
krlmlr commentedon Aug 21, 2018
Like in #458, this could be the responsibility of a different package. I'd rather not add this to tibble for now, but e.g. readxl could suggest an implementation which we then adopt. Would that work?
github-actions commentedon Dec 10, 2020
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.