y <- data.frame(x = c("63,98,131","75,109,145","66,104,139"))
I want to make three columns A,B,C from x by splitting from comma
A B C
63 98 131
75 109 145
66 104 139
I tried to use str_split
str_split(y$x, " , ")
[[1]]
[1] "63,98,131"
[[2]]
[1] "75,109,145"
[[3]]
[1] "66,104,139"
But this does not do the job. How can I fix it?