2 Replies Latest reply on Dec 28, 2016 8:23 AM by Nazirah Jetha

    Problem Running an R script through Tableau

    Nazirah Jetha

      I'm running Tableau 10.1.1, and R 3.3.2, doing a sentiment analysis in R via Tableau, using R's qdap library as RSentiment is now unsupported.


      I have managed to create the workbook, and calculations, gotten the calculations to run in R via Tableau:


      SCRIPT_REAL('scores(polarity(strip(.arg1)))[,"ave.polarity"]',ATTR([Comment Field]))


      This script works, and returns what I expect it to.


      I then saved the workbook.


      Restarted my machine for something unrelated, and needed to get back into the sentiment analysis workbook.  So, started my R console, loaded the qdap package, started RServe.


      Opened Tableau, pointed Tableau to the Rserve connection and it connected fine.


      Opened the workbook, tried to run the scripts, and I get the following error:


      "Error in eval(expr, envir, enclos) : could not find function "scores" "


      Copy and pasting the script into the R console directly works -- the script runs, returns what I expect it to.  However, trying to run it through Tableau gets me the above error.


      Any ideas?