r-script icon indicating copy to clipboard operation
r-script copied to clipboard

Error: No method asJSON S3 class: histogram

Open ghost opened this issue 5 years ago • 0 comments

I am trying to call simple R file which will call hist function. But when I call this function, I am getting following error

Error: No method asJSON S3 class: histogram

Execution halted

below is my R code

x <- c(1,2,3,4,5,6,6)

hist(x, col="lightblue")

and here is my index.js file


var express = require('express');
var R = require("r-script");

var app = express(); app.get('/', function (req, res) 
{      
	var out = R("example/sample.R")
  .data("hello world", 20)
  .callSync();
    console.log(out);

}) 
var server = app.listen(8081, function () {      var port = server.address().port   
   console.log(`Example app listening at http://localhost:${port}`)})

Similarly I cannot execute any other R function. example x <- c(1,2,3,4,5,6,6) print(summary(x));

I am getting error as below

Error: No method asJSON S3 class: table

Execution halted

ghost avatar Dec 23 '19 14:12 ghost