Given either a regular expression or a vector of character positions,
separate_col()
turns a single character column into multiple columns.
Examples
library(pliman)
df <- data.frame(x = paste0("TRAT_", 1:5),
y = 1:5)
df
#> x y
#> 1 TRAT_1 1
#> 2 TRAT_2 2
#> 3 TRAT_3 3
#> 4 TRAT_4 4
#> 5 TRAT_5 5
separate_col(df, x, into = c("TRAT", "REP"))