I am having difficulty achieving the following with stringr: I want to remove stray characters (up to two) flanked by a space on either side. I cannot get stringr to give me good results without an error. Two examples are below. Thank you in advance.
string1<-'john a smith'
output1<-'john smith'
string2<-'betty ao smith'
output2<-'betty smith'