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
dplyr::nest_by(data, x, y) is somewhat useful because I like that the variables you specify are the ones that end up outside the nesting. The equivalent nest(data, -c(x, y)) has always felt very awkward to me.
But really we'd like to pick one of nest(), nest_by() and group_nest() and deprecate the others.
It feels like tidyr is the right place for nest() to live, but it would be nice if we could somehow bring that by behavior over.
Maybe it is something like nest(.data, ..., .by = NULL/everything())? Then you could do nest(data, .by = c(x, y)) to get the nest_by() behavior. I still think you could use the ... in combination with .by, we'd just have to think about exactly how that would work (and can you duplicate variables in both .by and ...?)
We'd have to consider if this conflicts with the current behavior of nest(data) with no ..., which currently nests everything (rather than nothing, as might be expected by nest(data, .by = c(x, y)))
Consider how this conflicts with dplyr .by, and if that would be confusing or not. It might not be, because they seem to be very similar concepts.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
dplyr::nest_by(data, x, y)
is somewhat useful because I like that the variables you specify are the ones that end up outside the nesting. The equivalentnest(data, -c(x, y))
has always felt very awkward to me.But really we'd like to pick one of
nest()
,nest_by()
andgroup_nest()
and deprecate the others.It feels like tidyr is the right place for
nest()
to live, but it would be nice if we could somehow bring thatby
behavior over.Maybe it is something like
nest(.data, ..., .by = NULL/everything())
? Then you could donest(data, .by = c(x, y))
to get thenest_by()
behavior. I still think you could use the...
in combination with.by
, we'd just have to think about exactly how that would work (and can you duplicate variables in both.by
and...
?)We'd have to consider if this conflicts with the current behavior of
nest(data)
with no...
, which currently nests everything (rather than nothing, as might be expected bynest(data, .by = c(x, y))
)Consider how this conflicts with dplyr
.by
, and if that would be confusing or not. It might not be, because they seem to be very similar concepts.The text was updated successfully, but these errors were encountered: