[R] Extracting everything between two symbols in a string
gr.gianlucarossi at gmail.com
Sun Feb 16 13:50:03 CET 2014
I have a vector containing some names. I want to extract the title on
every row, basically everything between the ", " (included the white
space) and "."
 "Braund, Mr. Owen Harris"
 "Cumings, Mrs. John Bradley (Florence Briggs Thayer)"
 "Heikkinen, Miss. Laina"
 "Futrelle, Mrs. Jacques Heath (Lily May Peel)"
 "Allen, Mr. William Henry"
 "Moran, Mr. James"
I suppose grep with the argument `value = TRUE` might come useful but I
have difficulties on find the right regular expressions to accomplish my
combi$Title <- grep("", combi$Name, value = TRUE)
More information about the R-help