Sorry for this surely basic question, but I really couldn't find a clear answer:
I have a data frame I'm trying to split by a fixed number of characters
I'd previously been using:
data = cSplit(data, 'variable', sep="what to separate on", type.convert=FALSE)
...to split, but that causes issues if there are multiple instances of the "what to split on" in the data.
I want to split this names column by the first four characters (as splitting on "." causes issues for names with multiple "."
names
Mr. Joe Smith
Ms. Sarah A. Jones
Mr. Ryan P. Young
Ms. Chelsea White
Data
names <- c('Mr. Joe Smith', 'Ms. Sarah A. Jones', 'Mr. Ryan P. Young', 'Ms. Chelsea White')