I have a data set that I'd like to add quote marks to based on three rules:
- add quote marks before and after any =
- add a quote mark after any ( and before any )
- add a quote mark before and after any ,
For example
Input -> (Ten + Four = Fourteen, Two - One = 1)
Output -> "("Ten + Four"="Fourteen", "Two - One"="1")"
I must over-engineering this and was wondering if anyone had a good trick in base r?