-
Notifications
You must be signed in to change notification settings - Fork 133
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
Set old names as labels in clean_names
#563
Comments
@jospueyo , thanks for your interest in the package. And, I understand the value of keeping the original name associated with the column. I like that it seems you would make including the labels as optional with the So, I think that PR could be useful. As with any PR:
|
Sounds good to me too. After this is introduced I could see having tabyl() use labels where available, but that's unrelated (in code at least) to this suggestion. |
Looking at that Masto thread, some people talk about wanting to restore the original names at some point. Do we know if there's a function in another labelling package that transfers the labels into the column names? Kind of undoing the It seems like a potentially simple function, but (a) I hope someone else already wrote a good version we can point to (b) I don't want to overcomplicate things and there would be some thinking needed around say, what if only some of the original columns are present. |
Something like My experience with attributes like this is that they're lost easily. Creating a reverse function (like |
Looks to me like |
@sfirke, that looks like the right solution to me. We should refer to it in the documentation. |
Today I engaged in this thread in mastodon who led me to read this blog about data labels in R. I thought that would be nice that
clean_names()
had the option to keep the old names as labels in the dataframe.I think that would not be too complicated. I'm keen to propose a PR if I you were willing to accept the feature. It would be something like this...
If you don't like using superassignment, this can also be done in a for loop.
The text was updated successfully, but these errors were encountered: