How can I reference a matched string (or captured group) in R so as to append in a sub()
. For instance, I would do it like this in sed
to append a 'd'
to the match
echo "66xx" | sed 's/[0-9][0-9]/&d/g'
66dxx
How can I reference a matched string (or captured group) in R so as to append in a sub()
. For instance, I would do it like this in sed
to append a 'd'
to the match
echo "66xx" | sed 's/[0-9][0-9]/&d/g'
66dxx