I have a data frame with a dot-separated character column:
> set.seed(310366)
> tst = data.frame(x=1:10,y=paste(sample(c(\"FOO\",\"BAR\",\"BAZ\"),10,TR
You can use separate() from tidyr in combination with dplyr:
tst %>% separate(y, c("y1", "y2"), sep = "\\.", remove=FALSE)
x y y1 y2
1 1 BAR.baz BAR baz
2 2 FOO.foo FOO foo
3 3 BAZ.baz BAZ baz
4 4 BAZ.foo BAZ foo
5 5 BAZ.bar BAZ bar
6 6 FOO.baz FOO baz
7 7 BAR.bar BAR bar
8 8 BAZ.baz BAZ baz
9 9 FOO.bar FOO bar
10 10 BAR.foo BAR foo
Setting remove=TRUE will remove column y