[R] quotes in Rscript -e through system

abhagwat bhagwataditya at gmail.com
Thu May 24 12:58:32 CEST 2012


I figured out how to use quotes and parentheses when using Rscript -e (on a 
bash shell):
Rscript -e write\(1,\"a.txt\"\)

--> Question 1: why do the parentheses need to be escaped in the shell?
(More a shell than an R question)

Then I figured out how to use quotes and parentheses when calling Rscript
through system:
system('Rscript -e write\\(1,\\\'a.txt\\\'\\)')

--> Question 2: why exactly is it necessary to use double and triple
escapes? I kinda understand it, but not completely.

Thanks for your insights!

Adi





--
View this message in context: http://r.789695.n4.nabble.com/quotes-in-Rscript-e-through-system-tp4631186.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list