calligross / ggthemeassist

A RStudio addin for ggplot2 theme tweaking
490 stars 43 forks source link

Escape quotes in text fields #69

Open Breza opened 5 years ago

Breza commented 5 years ago

First off, I'm a big fan! I use ggthemeassist all the time when getting my plots ready for publication.

I keep forgetting to escape single quotes when writing titles, which results in an error when I'm done customizing my plot. In the example below, the word "I'm" caused the error. Any chance you can sanitize the inputs to prevent this from happening?

Warning: Error in parse: <text>:3:171: unexpected symbol
2:  + 
3: labs(title  =  'This is where the title goes. Yup, right here.', x  =  'Age', y  =  'Probability of a bad thing happening', subtitle  =  'The subtitle goes here. I'm
calligross commented 5 years ago

Thanks for the kind words. I made some small changes, I hope the problem is fixed. Please test it and give a short feedback.

Breza commented 5 years ago

Thank you so much, the problem is fixed! Again, this is an excellent addin and I appreciate the work you've put into it.