title: How to return a vector when connecting R with Tableau?
body: <p>I'm trying to return a vector through a Tableau calculated field. According to link below, Tableau can either receive a single value or a vector using connections to R through a calculated field.  </p>
  
  <p><a href="http://community.tableau.com/docs/DOC-5313" rel="nofollow">http://community.tableau.com/docs/DOC-5313</a></p>
  
  <p>see: </p>
  
  <blockquote>
    <p>"...If the R code returns a matrix of values, Tableau won’t know what to do, we have to return a single value or a vector,..."</p>
  </blockquote>
  
  <p>This is what I have in my calculated field, where Parameter 1 and Parameter 2 are just arbitrary values (just for demonstration purposes):</p>
  
  <pre><code>SCRIPT_REAL ('testvector &lt;- c(.arg1, .arg2); testvector',min([Parameter 1]), min([Parameter 2]))
  </code></pre>
  
  <p>I was expected a single vector to be returned, but I'm getting the following error message:</p>
  
  <pre><code>## Error: Unexpected number of results returned by SCRIPT function.  Function expected 1 values; 2 values were returned. 
  </code></pre>