str_split(
c("regular_structure", "in_my", "data_here"),
sep="_",
names=c("apple", "banana")
)
x <- c("somewhat_different.structure", "in_this.guy")
str_split( x, "[_\\.]", names=c("first", "second", "third") )
Run the code above in your browser using DataLab