-
Notifications
You must be signed in to change notification settings - Fork 991
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
Additional arguments for setcolorder: before, after #4358
Comments
Was just thinking about it. It has been implemented in dplyr 1.0.0: |
I had some implementation suggested on #4668. If there is a plan to add this feature, I'd love to submit a PR. |
Thanks for the PR. As a humble data.table user, I think I would prefer having |
Arguments like Changing
edit: adding some testcases
|
Thanks for all the comments! @ben-schwen After reading your code I found all my code can be replaced with yours. Mine was originated from a separate function, the original design is simple, but to make it work with new api (instead of Your code is much more shorter because
This is a much better implementation, fully utilized existing structures to make the new changes very short. I don't think I need to continue my PR anymore, can you create a PR with your code? (The only suggestion I want to make is the error message could be "before= and after= cannot be specified at the same time", this is subjective but I feel it be easier to read) |
Seeing @ben-schwen may not have time to create the PR, I created a PR #4691 with his implementation and full credit go to @ben-schwen . |
What became of this in the end? |
@dracodoc, your PR does not pass the build pipeline. Are you willing to give it another try? If not, I will try to find the time to take over. |
I'm not sure what was the problem. Was it just test case orders? I just modified the test cases and pushed an update, let's see if it pass this time. The tests run without problem for me. |
I don't know. I can't look into the detailed test results. |
I think I knew what caused original error. I'm updating the commit and wait for next build check. |
Looks all checks passed this time. @matthiasgomolka can you have a look? |
Yes, now it passes the tests. But I don't know the usual procedure if and when a new PR is merged. @jangorecki, you already had a look at this issue. Can you explain the next steps? |
Once PR is passing tests the next step is to wait for reviews and merging. |
Closed by #4691 which implements this. (It didn't have "closes" in the description so this issue didn't get closed automatically by the merge.) |
It would be nice to have two additional arguments (
before = NULL
andafter = NULL
) insetcolorder()
for reordering one or more columns to a position other than the "front" of thedata.table
. This would make it possible to place a single column after the, say, 45th column, without having to list all these 46 columns.After having a look at the code, I think I could try to file a PR if you think this feature is helpful.
The text was updated successfully, but these errors were encountered: