-
Notifications
You must be signed in to change notification settings - Fork 103
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
Correcting the rename dialog? #9265
Comments
Thanks for this @rdstern. The issue is that the code is looking for the wrong columns because you're using "Starts with" not "Matches".
So all you need to do is change from the "Starts with" option to "Matches": (I've put the replacement as NEW as otherwise there's an issue that we already have a column called |
@lilyclements great. I also misunderstood the error that I got, because I assumed it was because of the dot and regex. It was because of the names being duplicated. You see I wanted it to be simple. Just delete Xdot from the start of each name - So I was really happy that I can easily replace Xdot by NEW using starts with and no trouble! I still need to write this up properly in the help, and possibly edit the dialog a bit if some options assume regex by default and others do not. |
@N-thony thanks for reporting. That error is that the |
Yes, that is correct, @derekagorhom or @Fidel365 can easily fix this. |
WE are often hitting an error after using the Rename with button and then using with the Single or the Multiple Buttons afterward. It still tries to process the rename with option. It is always resolved by pressing Reset. Here is an example to try: Importing the file I want to delete the superflous dates (9 columns), or trhe Then change Date to Day followed by Rename With, on Edit > Starts with X. to nothing works fine. But the X, forst and then changfinf Date to Day afterwards, gives an error. |
@Fidel365 any plan on this? |
@N-thony on it |
@N-thony, @Fidel365 and @lilyclements While we are talking about the Renaming Dialog I have a question. Why is the edit option only available on the data frame tab. It seems like it would be useful on the Selected Variables tab too, could it be added? All the other options seem to be the same. |
@lilyclements a question for you. @Fidel365 has solved the bug and I hope we can merge. I think we had @rachelkg question earleir - in #8439 on why we can't have the edit option with just selected variables. And we can't is that right. As I write this, I will also check whether (if that's the case) we could get the same thing by applying a select first! That would be nice. Oh no, now I realise! If select is applied, it used to give a bug. Now it just takes off the select. And it could pile up problems later, maybe with none unique names? Let's confirm that first. Then I have another @lilyclements question, though maybe more an @N-thony question?. It is easy to get the dplyr error with the example I use - given above. That's because the proposed Edit results in non-unique names. Now I don't want it to become clever and adjust the names. I'd like an error message, but clearer, namely that the edit is producing non-unique names in the data sheet. Here is the error message: I wonder if it can come with any of the options, but assume it is mainly with Edit? If we can't do better, then we could maybe add a line within the box It is quite a nice example that with power comes risks! By the way we can (of course) make the same error with the simple use of rename - so I did! Then I get this message: I like that message! And I'm liking our forthcoming work in the help file. And I'm even wondering whether there's a practice document and video needed. Maybe we could combinethis and have one called |
@rdstern I have been looking at the issue the selection, I think the message you had before was "Unable to retrieve the data..." when trying to rename a selected column. The problem was with the selection condition, when refreshing the data after renaming a selected column, R was not able to find the columns in the selection condition which is now old in the current data. |
@lilyclements and @Fidel365 I wonder if there is an error in the I also have an example below, where I want to change multiple dots to spaces. I'd like to check it does them all, and not just the first in the string. Introductory e-siac Survey.xlsx (Once I have changed the dots to spaces, then I copy the names into the variable labels.) |
t2_subset.xlsx
Here is a dataset where many variables start with
X.
I would like to delete the
X.
from the names using thre Rename 3rd option by a function.If I do it really simply, namely replace X. by empty, it gives and error in dplyr. I think that is because of the default using regex. So I tried replacing
X\\.
and it no longer gives an error, but also doesn't replace.Help please and we should also write this up. Can @N-thony or @lilyclements help?
The text was updated successfully, but these errors were encountered: