Planeshifter / node-Rstats

[UNMAINTAINED] An interface for node.js to statistical programming language R based on the fabulous Rcpp package
GNU General Public License v2.0
59 stars 16 forks source link

SyntaxError: Unexpected token I #13

Open mjadobson opened 8 years ago

mjadobson commented 8 years ago

For this test case:

var rstats  = require('rstats');
var R  = new rstats.session();

var result = R.parseEval("fisher.test(matrix(c(0,96,0,825), nrow = 2))");

This error occurs:

SyntaxError: Unexpected token I
    at Object.parse (native)
    at Object.<anonymous> (/Users/mjadobson/code/r_bridge_error_case.js:4:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

The parser seems to be confused with Inf. Output from R is:

    Fisher's Exact Test for Count Data

data:  matrix(c(0, 96, 0, 825), nrow = 2)
p-value = 1
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
   0 Inf
sample estimates:
odds ratio 
         0