joshkatz / r-script

A simple little module for passing data from NodeJS to R (and back again).
MIT License
161 stars 67 forks source link

How to get the output back to NodeJS #13

Open tnvrsingh opened 6 years ago

tnvrsingh commented 6 years ago

Say that my R script returns a single value. How am I supposed to get it back from R to my Node Application?

wilau2 commented 6 years ago

In my use case, im redirecting the output to a file, than reading it from node R file

write(jsonscore, file = paste0( "path/",  "myResult.json"))
 const rolefitResult = require('path/myResult.json');
letrape commented 6 years ago

The last line of your R file is returned to the parent