Is it possible to execute an existing .R script file from within a Lua session? From this helpful page I know that you can access existing R-Sessions and extract objects from it. I also know that you can execute single commands with e. g.
local R = require "rclient"
local r = R.connect()
r "var <- c(1:10)"
local var = r.var
I have a pretty long R script that I don't want to run separately from outside Lua neither do I want to paste every line in the Lua script.
Is there a way to run the script from within Lua and, for example, pass Lua variables to the R script, and, afterwards, access the R objects?