noamross / zero-dependency-problems

Real-world code problems in R, without dependencies
79 stars 25 forks source link

concatenate-with-strings #6

Open dpastoor opened 9 years ago

dpastoor commented 9 years ago

so the solution relies on the person knowing how to escape string characters. A googling of 'add quotes paste R' takes right to a stack overflow answer.

An additional 'side effect' issue is that beginners or even 'intermediate' users that aren't familiar with the nuances of the REPL, will think that the escape characters, even though rendered int the repl, will not show up when actually written out to a file/knitted

paste("\"red\"", "\"green\"", sep = ",")

should do the trick