I want to extract titles (Mr, Mrs, Miss) from within the Name column and import those extracted titles into a new column Title. Relevant data looks like this:
snippet <- data_frame(Name=c('Braund, Mr. Owen Harris','Cumings, Mrs. John Bradley','Heikkinen, Miss. Laina'),Column=c('blah','blah,'blah'))
I've reviewed this answer, but I must be missing something.
Here's the best code I could come up with: snippet <- mutate(snippet, Title = str_extract(snippet $Name, "(?<=,)[^,]*(?=.)"). This does add the Title column, but all values within that column are NA. Where's my error? Thanks.