R - Conditional Substr from dataframe -


i need substr column based on start , end locations. start , end locations derived character search.

for example, single column in dataframe 3 rows:

'bond, mr. :james' 'woman, mrs. :wonder' 'hood, mr. :robin' 

expected answer in column 2 is:

'mr.' 'mrs.' 'mr.' 

i want extract strings in between ',' , ':' column 1.

try gsub(".*, | :.*", "", myvec)


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -