I have two very simple files to test my integration setup. First the r script inside test.R:
print('hello')
Then the index.js calling that file:
var R = require("r-script");
var out = R("./test.R")
.data()
.callSync();
And this is what my console is telling me:
$ node index.js
/home/user/index.js:3
.data()
^
TypeError: Cannot read property 'data' of undefined
Currently, I am running Ubuntu 18.04 and if I run only Rscript test.R it works with no problem. Any help?
I fix my similar issue with https://github.com/joshkatz/r-script/issues/19
If you still feeling lazy to pull the git, you can directly update the source code ./node_modules/r-script/index.js , then edit the function init as
I hope you may find this helpful.
in my case, downgrade underscore works