0

While testing vader_df function for sentiment analysis in R for the very first time, I noticed that the function is returning some NA values for compound scores. Now, some of the text data is empty for which NA result is acceptable, but with valid text data why do the function return NA value.

library(schrute)
library(vader)
data <- theoffice["text"]

vader <- vader_df(data$text)[3]

data <- cbind(data,vader)
summary(data)

data_na <- data %>%
filter(is.na(compound) & !nchar(text) == 0)
data_na

Please note the NA is the compound column. Now some of them are NAs because the empty. But even with valid text columns, vader_df() gives NAs results. Why? Specifically there are nine observations with valid text but NA compound result.

If anybody have experience of Valence Aware Dictionary and sEntiment Reasoner (VADER) in R, please help out. I am using 'vader' package. If anybody have better resources for running vader analysis, do let me know.

Have a nice day.

  • Dear, Please consider me as a newbie in this area. I had no other skills except for displaying images. Could you please provide a guide on how to use dput? – Salman Virani Jan 28 '23 at 22:01
  • Instead of the images ( we cannot copy the code from the images), you may use the code within markdown chunks. Also, get the data for testing with `dput` i.e. `dput(head(data, 20))` (first 20 rows of your data) and copy/paste the structure output in your post. This gives the exact structure of your data if others want to test – akrun Jan 28 '23 at 22:03
  • Dear, I hope the changes in the questions makes it easier for people to help. – Salman Virani Jan 31 '23 at 07:43

0 Answers0