-
Notifications
You must be signed in to change notification settings - Fork 371
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
Add select, select!, transform and transform! for GroupedDataFrame #2172
Comments
Relevant discussion: #1727 (comment) |
Sorry for not being precise - I just wanted a quick example. assume the following options of
My opinion is that our API was not designed to handle this case. My current thinking is, that if we want such a functionality we should have another function that could be called e.g.
and
I do not see other way to avoid the ambiguity in corner cases (but I might be missing something, so please comment here). However, in general - I came to the conclusion that adding an |
I still don't really see the problem. For What I agree is more tricky is things like |
For But Let us just recap if we are on the same page what So in short - If yes - then - the discussion about keeping of the row order of the parent data frame is immaterial for But I think I see a solution to what we discuss in changing a kwarg to
The only thing there is that in
|
We could apply the transformation to the parent. That's the most useful behavior anyway, as that's the only way to add a column based on grouped operations without copying other columns.
Yes, I agree. Though I think the row order is significant as you can observe it via
Maybe that could be the difference between Of course it could be useful to have a keyword argument to all functions -- but with a different default. Not sure about |
Yes - having a different default would make sense, especially as |
That's what dplyr does with Throwing an error will protect from the annoying case in which you return a variable number of rows, and for some reason it happens to match the original number of rows. |
Yes - this is what I meant (actually we have exactly this bug in 0.20.2 and now it got fixed on master) |
closed via #2214 |
Allow to pass
GroupedDataFrame
toselect
,select!
,transform
andtransform!
. It should work likecombine
but returne aGroupedDataFrame
.The text was updated successfully, but these errors were encountered: