Hello there, consider this simple example
mytib <- tibble(var1 = c('hello world', 'all your base', 'are belong', 'to us'),
var2 = c(1,2,3,4))
# A tibble: 4 x 2
var1 var2
<chr> <dbl>
1 hello world 1
2 all your base 2
3 are belong 3
4 to us 4
I am trying to use this tibble to generate another tibble. The idea is simply to break down a long list into multiple columns. I do not understand what is wrong with this code
mytib %>%
tibble(one1 = .$var1[1:2],
two1 = .$var2[1:2],
one2 = .$var1[3:4],
two2 = .$var2[3:4])
Error: Tibble columns must have consistent lengths, only values of length one are recycled:
* Length 2: Columns `one1`, `two1`, `one2`, `two2`
* Length 4: Column `.`
Call `rlang::last_error()` to see a backtrace
where is this column . coming from?
Thanks!