String Manipulation with stringr in R
Charlotte Wickham
Assistant Professor at Oregon State University
REF1
<regex> \1
REF2
<regex> \2
SPC %R%
one_or_more(WRD) %R%
SPC
SPC %R%
capture(one_or_more(WRD)) %R%
SPC %R%
REF1
str_view("Paris in the the spring",
SPC %R%
capture(one_or_more(WRD)) %R%
SPC %R%
REF1)
str_replace("Paris in the the spring",
pattern = SPC %R%
capture(one_or_more(WRD)) %R%
SPC %R%
REF1,
replacement = str_c(" ", REF1))
"Paris in the spring"
String Manipulation with stringr in R