powered by
type.convert
colsplit(string, pattern, names)
x <- c("a_1", "a_2", "b_2", "c_3") vars <- colsplit(x, "_", c("trt", "time")) vars str(vars)
Run the code above in your browser using DataLab