library(stringr) points$organ = str_split_fixed(points$x, "\\.", 2)[, 1] points$stage = str_split_fixed(points$x, "\\.", 2)[, 2]