1 Reply Latest reply on Mar 22, 2016 4:14 PM by Erwan LE BRUN

    Sentiment analysis in Tableau with R : Error in tableau whereas the function works well in R.

    Erwan LE BRUN

      Dear Experts,

       

      I'm trying to perform a sentiment analysis using R.

      I installed the needed packages ( TM, RSTEM, RSERVE, sentiment, ..)

      In the R script editor I can execute the following line and get the correct result :

      classify_polarity('I love cupcakes', algorithm=”bayes”,verbose=TRUE)

       

      In tableau, I'm using the following new calculated field with :

      SCRIPT_STR(classify_polarity(.arg1,algorithm=”bayes”,verbose=TRUE)[,4]’,

      ATTR([Text]))

      where "Text" is the column I need to analyze.

       

      When testing the R connection from tableau, it's always successful, nevertheless I encounter the following error :

      Error in eval(expr,envir, enclos): could not find function “classify_polarity”

       

      Anyone has a clue ? Don't understand what could be wrong.

       

      Thx a lot,

      Erwan