Displayr uses R to calculate the Sentiment Score from text variables. All R variables in Displayr must be calculated within two minutes by default. However, in some instances, when working with large data files and longer open-ended text responses, the analysis takes longer to run, resulting in a time-out error. This article explains what to do in these cases.
Requirements
A Text variable. Text variables are represented by a small a next to the variable in the Data Sources tree:
Method
- From the toolbar, go to Calculation
> Custom Code.
- Click on the page to place the custom calculation.
- Paste the following code into the R Code editor:
library(flipTextAnalysis)
You will need to update "Likes" on Line 4 with the Name of your input text variable.
#Define variable name, which can be found in General > Name
input <- Likes
#Calculate the Sentiment Scores
sentiment.scores <- SaveNetSentimentScores(input, check.simple.suffixes = TRUE, blanks.as.missing = TRUE) - Click Calculate.
- Hover between any two variables in the Data Sources tree and click Plus (+) > Custom Code > R > Numeric.
-
In the R Code box for the variable, click the name of the output calculated in step three to reference the data. In this case, the output should be called sentiment.scores.
-
Click Calculate.
- In the object inspector, go to the General tab and update the variable Label and Name.
- The resulting numeric variable can be used to show the sentiment score.