-
Notifications
You must be signed in to change notification settings - Fork 1k
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
More weird behaviour with colnames and setcolorder #5494
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
Seems related to #5133 |
I'm pretty sure that assigning new names using
Please note this isn't an MRE, because I lack a reliable way to determine whether or not I have actually corrupted I'm hoping the |
setcolorder
messes with the names of a vector previously defined usingcolnames
.It appears that assigning names to a vector using
colnames()
is by reference, so reordering the columns of the table results in those vector names also being re-ordered, but the elements of the vector are not. This results in the vector elements no longer corresponding to the actual data columns of the table.Is there a good reason that
colnames
should not provide a copy of the column names rather than a pointer?Created on 2022-10-21 by the reprex package (v2.0.0)
The text was updated successfully, but these errors were encountered: