Search code examples
rrscript

invoke Rscript without a script name


I would like to call Rscript without a proper script, just by writing it in a console. is it possible? something like

c:/path/to/R/bin/Rscript.exe "here is a R code, not a R file"

I am on Windows.


Solution

  • Run Rscript with -e argument:

    Rscript -e "getwd()"