can I define and call R functions?
Also, can I load other R libraries?
Since you can execute any R code from inside node, this is certainly possible. Currently you could do both via the parseEvalQ method. For example, to load the xtable R library into the R session, one would execute R.parseEvalQ('library(xtable)'). To define a function which adds the value two to all elements of a vector, we could do R.parseEvalQ('add2 <- function(x){ x + 2}'). However, to call it you would have to manually create the appropriate R code as a string and then again invoke it via parseEval just like any other function. In the future, I will try to come up with a nicer way to call R functions. Hope that helps.
It would be very useful to have methods to load and install packages. And to support DataFrames :-)
And to support DataFrames
@psanchez1982 This works for me:
R.parseEvalQ("df = data.frame(x=1:2, y=3:4)");
var df = R.get("df");
console.log(df);
// result: [ { x: 1, y: 3 }, { x: 2, y: 4 } ]