How to invoke an R script like the following
scan()
in Windows? When using either R
or Rscript
, nothing is read. With Rscript
or littler
(both on Linux) the script works as expected.
# Doesn't work because stdin is already redirected
R --no-save < test.R
# Works on Linux, doesn't on Windows
Rscript test.R
# Works on Linux, doesn't exist in Windows
r test.R
Is there any way at all to achieve this without changing the R code?
Perhaps related: Why is there no --interactive
switch in Windows?