powered by
separate()
separate(data, col, into, sep = "[^[:alnum:]]+", remove = TRUE, convert = FALSE, ...)
If character, is interpreted as a regular expression. The default value is a regular expression that matches any sequence of non-alphanumeric values.
If numeric, interpreted as positions to split at. Positive values st
TRUE
type.convert
as.is = TRUE
strsplit
library(dplyr) df <- data.frame(x = c("a.b", "a.d", "b.c")) df %>% separate(x, c("A", "B"))
Run the code above in your browser using DataLab