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
I recently found out that all_of() and any_of() can be used with a named vector inside dplyr::rename() to rename variables. This is a very helpful, though undocumented feature (see reprex below). I assume that this is intended behavior.
In that case, I wonder whether it might be worth adding to the documentation of rename() which doesn't mention the use of selection helpers so far.
Since the documentation of tidyselect::all_of() doesn't contain an example using a named vector this might also be an issue for the tidyselect repo. However, I think adding it to rename()would be helpful, since it is a common problem to rename columns based on lookup vector which contains more names than the actual data.frame.
I recently found out that
all_of()
andany_of()
can be used with a named vector insidedplyr::rename()
to rename variables. This is a very helpful, though undocumented feature (see reprex below). I assume that this is intended behavior.In that case, I wonder whether it might be worth adding to the documentation of
rename()
which doesn't mention the use of selection helpers so far.Since the documentation of
tidyselect::all_of()
doesn't contain an example using a named vector this might also be an issue for the tidyselect repo. However, I think adding it torename()
would be helpful, since it is a common problem to rename columns based on lookup vector which contains more names than the actual data.frame.Created on 2023-01-18 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: