-
Notifications
You must be signed in to change notification settings - Fork 368
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
Stacking multiple groups of columns #2414
Comments
I think the proposal makes sense and thinking of the API what you proposed is roughly the simplest thing that can be proposed. |
Hi! I just want to comment to keep track of this issue. I often encounter instances where this feature would be useful and wonder if there's been any progress. I believe that this relates to a previous discourse question. |
It is tracked. I have now increased the priority to 1.5 release. Before discussing the API let me first comment what would be my natural way of doing what you want without this change:
(with a different order but the order can be changed with sorting; the originally proposed order is inconsistent with Given this let us discuss the request:
(note that I use
to conveniently give values in Example of surprise conversion showing why vector is problematic:
CC @nalimilan |
Thank you for the discussion!
I find these types of transformations to be useful and would certainly appreciate the convenience of this added functionality within the In terms of implementation, I fully agree with your proposal above (including the use of the Tuple as the second argument). It seems intuitive. I do not feel that the |
I have already thought about it - it is not that hard, so I think we can add it in 1.5. |
Makes sense. I wonder whether the tidyverse's |
For me a more natural way to think about this is via nested columns (per example I have given) but if users prefer unnested columns we can add it. |
I am closing this in favor of #3237 (to have a single place to discuss all related issues) |
I have a data frame that contains multiple groups of columns and I want to stack them up. If there were only one group, then the regular
stack
function would have worked. But, I have two groups as shown in the following MWE:So the data looks like this:
And, I need to transform it to something like this.
My current solution is somewhat manual:
Is it possible to make it more generic since it's really a stacking function?
Just an idea:
The values
1
and2
above are really group names for the columns. In this case, the group is calledorder
.The text was updated successfully, but these errors were encountered: