I am trying to split a string in multiple columns, currently I have this list in a data frame. Every string has different length, and I can't always predict it, I would like to split by ",", remove the "(" and ")" and have every variable in a column.
x
(1,2,3,4,5)
(1,2,3,4,5,6)
(1,2,3,4,5,6,7)
I already tried but does not work
y = strsplit(as.character(df$x),',')
desired output
x x x x x x x
1 2 3 4 5 n/a n/a
1 2 3 4 5 6 n/a
1 2 3 4 5 6 7