Open arthurgailes opened 5 months ago
Thanks. Let me thing about it for a bit. I agree that this is the most parsimonious way of adding this, but fundamentally rsplit()
is a recursive function and not designed to output a data.frame. I think a better way to go would be properly implementing nest()
and unnest()
. So far I've seen this as unnecessary because you can simply do qTBL(mtcars) |> gby(cyl, vs, am) |> smr(list(data = list(.data)))
, but I can think about it.
Sure thing. Perhaps something like:
fnest <- function(data, ..., .key = "data") {
smr(
gby(data, ...),
setNames(list("col" = list(.data)), .key)
)
}
Could probably do more here, e.g. allowing for a rename of $data and unnest, but stopping here in case this is out-of-scope.