在没有脚本名称的情况下调用 Rscript

invoke Rscript without a script name

我想在没有适当脚本的情况下调用 Rscript,只需在控制台中编写即可。可能吗?像

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

我在 Windows.

运行 带有 -e 参数的 Rscript:

Rscript -e "getwd()"