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
In the example below, if I nest dt2, the rowwise_df class is preserved in each list column element, I'm wondering if nest_join() should have a similar behavior?
# set up `dt1` with an id column and some random numbers
set.seed(123)
dt1<-tibble::tibble(
id= c(1,2,3),
a= rnorm(n=3)
)
# set up `dt2` as a rowwise dataframe with `id2` nested inside `id1` column
set.seed(123)
dt2<-tibble::tibble(
id= rep(c(1,2,3), each=3),
id2= rep(c("a", "b", "c"), 3),
b= rnorm(n=9)
) |>dplyr::rowwise()
# nesting `dt2` gives each element in data as a `rowwise_df`dt2|>tidyr::nest(data=-id)
#> # A tibble: 3 × 2#> id data #> <dbl> <list> #> 1 1 <rowwise_df [3 × 2]>#> 2 2 <rowwise_df [3 × 2]>#> 3 3 <rowwise_df [3 × 2]># but `nest_join()` doesnt not preserve the `rowwwise_df` class dt1|>dplyr::nest_join(dt2, by="id")
#> # A tibble: 3 × 3#> id a dt2 #> <dbl> <dbl> <list> #> 1 1 -0.560 <tibble [3 × 2]>#> 2 2 -0.230 <tibble [3 × 2]>#> 3 3 1.56 <tibble [3 × 2]>
In the example below, if I nest
dt2
, therowwise_df
class is preserved in each list column element, I'm wondering ifnest_join()
should have a similar behavior?Created on 2022-06-13 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: