Suppose that I have a R script called test.R
, stored at C:\
, with the following content:
x <- "Hello Stackoverflowers"
print(x)
To run it via terminal one could simply call:
Rscript C:\test.R
And as expected, the result will be:
However, what I wonder is whether there is a way to run test.R
via Windows console but after that staying within the executed R session instead of closing and going back to the console cursor? That is, staying inside the R session instead of going back, in the image above, to C:\R\R-3.4.1\bin>
.
For instance, when compiling Python code with python.exe
I can easily accomplish a similar thing by passing the -i
parameter to the python.exe
call.
How could I do that with R?