[R] R 2.11, shell, spaces

Oliver Soong osoong+r at gmail.com
Tue Sep 7 23:01:13 CEST 2010


Can somebody confirm some unexpected behavior?  This is under Windows,
with R 2.11.0 and 2.11.1.

1. Create a trivial test file (I called it test.R) containing:
cat("Success.\n")
2. Load R (Gui or Term) and run:
shell("\"C:\\path\\to\\Rscript.exe\" \"C:\\path\\to\\test.R\"")

In my case, I get various error messages.  If the
path\\to\\Rscript.exe has spaces or not, it complains that the first
token (e.g., 'C:\Program') is not a valid command.  If the
path\\to\\Rscript.exe has no spaces, it complains that the specified
path is invalid.  If C:\\path\\to\\test.R has no spaces, and I remove
the surrounding quotes, things work as expected.

I think this might be related to some earlier e-mail traffic that I
didn't see a satisfactory resolution to.

Cheers,
Oliver



More information about the R-help mailing list