All the searches online seem to be 'vectors -> columns' instead of 'vectors -> rows' and the problem is that there are too many unique values in the vectors and rows, resulting in a massive matrix that grows too much, essentially nrow()
per unique string.
library(tidytable)
df_example <- tidytable(a = list(c('a','b'),
character(0),
"z",
c('y','z')),
id = list('aa', 'bb', 'cc', 'cc'))
In the above example, there are all types of values in column a
. I don't have any values akin to c('d')
in that column (it would just be 'd'
).
What I would like is to essentially pivot_longer()
those vectors into multiple rows, similar to the following:
df_example <- tidytable(a = list('a', 'b',
character(0),
"z",
'y', 'z'),
id = list('aa', 'aa', 'bb', 'cc', 'cc', 'cc'))
How would I be able to achieve this?