[R] Cannot use R on Windows when installed to an external drive with a space in the path

Marc Capavanni m@rc@c@p@v@nn| @end|ng |rom goog|em@||@com
Mon Oct 22 15:34:22 CEST 2018


Hi all,

This is my second time posting this, I accidentally sent the first email
without the proper subject header. Hopefully this won't create any noise
and a moderator can dismiss the first one.

I'm considering filing this as a bug report but wanted to make sure first
that I'm not doing something wrong.

A piece of software which I develop installs R as part of its dependencies.
This normally works perfectly fine. However we noticed a bug when
installing to external drives on a path that includes a space, RScript.exe
and R.exe will not work.

E:\Program Files (x86)\R-3-3-3\bin>Rscript.exe
'E:\Program' is not recognized as an internal or external command,
operable program or batch file.

As you can see I'm in the directory itself, and simply calling the
executable without entering a path.

Similarly, if I do enter the full path with quote marks, I get the same
issue.

E:\>"E:\Program Files (x86)\R-3-3-3\bin\Rscript.exe"
'E:\Program' is not recognized as an internal or external command,
operable program or batch file.

At this stage I'm thinking it's either an R bug or a Windows bug, but I can
run the following just fine.

E:\Program Files (x86)\HelloWorldProj\bin>HelloWorldProj.exe
Hello, world!

I've tested this with two variables.

 A - Using the R installer OR Simply copying the binaries
 B - Writing to E:\R-3-3-3 OR Writing to E:\Program Files (x86)\R-3-3-3

A does not affect the outcome in any way, however R only works when B uses
the path without spaces.

I searched elsewhere on the internet for the same and interestingly it was
another R install with this issue. I believe the commenters here were
erroneously attributing it to the user.

https://stackoverflow.com/questions/43510438/how-to-run-an-executable-that-contains-a-space-in-path-from-command-line-on-wind

Any thoughts? I'm open to a sensible workaround, and if it is a bug I'm
happy to raise it.

Thanks,
Marc

	[[alternative HTML version deleted]]




More information about the R-help mailing list