Skip to content

Conversation

arthurgailes
Copy link
Contributor

No description provided.

@arthurgailes
Copy link
Contributor Author

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.

@SebKrantz
Copy link
Owner

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.

@arthurgailes
Copy link
Contributor Author

Sure thing. Perhaps something like:

fnest <- function(data, ..., .key = "data") {
  smr(
    gby(data, ...),
    setNames(list("col" = list(.data)), .key)
  )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants