title: How to get a JSON table back from an openCPU RPC request?
body: <p>I've written an R function in my package which returns a data frame. I'd like to call my function from javascript and use it to populate a table. I am able to successfully call the function using the <code>ocpu/test</code> interface and get back <code>JSON</code>.</p>
  
  <p>I'm looking for a minimal example of how to do it with <code>ocpu.rpc</code>. I was thinking it could be finding the leading rows of the <code>faithful</code> data set using <code>head</code>: e.g. <code>head(faithful)</code>. However, I think that the <code>ocpu.rpc</code> request can't be used with data already in R.</p>
  
  <p>Based on the documentation, I thought the code should be:</p>
  
  <pre><code>ocpu.seturl("http://public.opencpu.org/ocpu/library/mylib/R");
  var req = ocpu.rpc("func", { x : "param" }, function(obj) { return obj });
  </code></pre>
  
  <p>But <code>req</code> is undefined when I inspect it. What am I missing?</p>