I try to create a sequence of all columns in my dataframe, which looks like this:
df <- data.frame(label = c("ger", "at", "uk", "us"),
a = c(1,2,3,4),
b = c(2,3,5,1),
c = c(5,6,2,1))
This comes close, but does not provide the desired result:
df %>% nest(data = c(a,b,c))
label data
<chr> <list>
1 ger <tibble [1 x 3]>
2 at <tibble [1 x 3]>
3 uk <tibble [1 x 3]>
4 us <tibble [1 x 3]>
Instead of a tibble, I want a vector. It should look like this:
label data
<chr> <list>
1 ger <dbl [3]>
2 at <dbl [3]>
3 uk <dbl [3]>
4 us <dbl [3]>
Does anyone know to do archieve this?