I am trying to execute the following nodejs code
var rstats = require('rstats');
var util = require('util');
var R = new rstats.session();
R.parseEvalQ("mat = matrix(1:4,ncol=2,nrow=2)");
var mat = R.get("mat");
console.log(util.inspect(mat))
I am getting Error: could not find function "toJSON" error on the line var mat = R.get("mat");
I have RJSONIO installed in R.
I am running this on Ubuntu.
Is there something that I should look out for?