My attempt to utilize the t-test in R using OpenCPU looked like this -
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//cdn.opencpu.org/opencpu-0.4.js"></script>
and
ocpu.seturl("//public.opencpu.org/ocpu/library/stats/R")
var x = [1,2,3,4,5,6,7,8,9,10];
var y = [7,8,9,10,11,12,13,14,15,16,17,18,19,20];
// call R function: stats::t.test
var req = ocpu.rpc("t.test",{
"x" : x,
"y" : y
}, function(output){
alert("t.test equals: " + output);
});
//optional
req.fail(function(){
alert("R returned an error: " + req.responseText);
});
Unfortunately, I encountered this error
https://i.sstatic.net/yUG43.png
I am perplexed by where I might be making a mistake