I am trying to run the following R script in windows shell:
Rscript C:/Documents/Folder name containing space/myscript.txt
In this case I g
Forward slashes work just fine with R, so don't worry about backward slashes. I've just verified and the following works at the CMD.exe terminal of Windows 8.1:
C:\Windows\System32> Rscript "C:/Users/hb/folder with spaces/script.R"
[1] "1+2+3"
C:\Windows\System32>
My best guess is that you've got the pathname incorrect. If it's a non-existing pathname, you do get:
C:\Windows\System32> Rscript --vanilla "C:/Users/hb/folder with spaces/non-existing.R"
Fatal error: cannot open file 'C:/Users/hb/folder with spaces/non-existing.R': No such file or directory
You can validate it from within R, e.g.
> file.exists("C:/Users/hb/folder with spaces/script.R")
[1] TRUE