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
Post a Comment