Reputation: 133
tbl = tibble(a = c(1,2), b = c(3,4))
tbl2 = tibble(id = 1, t = nest(tbl) %>% flatten())
As above codes, I can put tbl
as one element into tbl2
, but
the warning message shows
`...` must not be empty for ungrouped data frames. Did you want `data = everything()`?Warning message:
could you tell me how to do to omit the warning message?
Upvotes: 0
Views: 631
Reputation: 136
In order to get the solution proposed by @Sotos with the hint from the warning, use the (apparently undocumented) option of the nest
command, as follows:
tbl2 = tibble(id = 1, t = nest(tbl, data=everything()) %>% flatten())
It may be worthwhile noting (slightly off-topic) that this option also exists for the unnest
command.
Upvotes: 1