I am trying to replace the commas inside all sets of parentheses with a semicolon, but not change any commas outside the parentheses.
So for example:
"a, b, c (1, 2, 3), d, e (4, 5)"
should become:
"a, b, c (1; 2; 3), d, e (4; 5)"
I started doing this with gsub, but it is very difficult for me to understand / figure out how to identify these commas in parentheses.
I would call myself an advanced beginner with R, but with regular expressions and text manipulation, complete noob. Any help you can provide would be great.
scrrd source share