I've been trying to access and fool around with data frames using OpenCPU's JS library for ages now, but no matter what I try, I can't seem to get it to work. Here's my latest code sample, very straightforward:
var dat = [1, 2, 3];
var dat2 = ["a", "b", "c"];
var req = ocpu.call("data.frame", { x: dat, y: dat2 },
function(session) {
session.getObject(function(data) {
alert(data);
});
});
Unfortunately, all I get is [object Object],[object Object],[object Object]
as the output. What do? The data frame is being created properly; session.getConsole
shows me the correct console output. Why won't it return properly? I've tried calling data.frame
, as.data.frame
on JSON data as well; same problem. I'd appreciate some help.
Cheers.