-1

enter image description here

So i already have the score for my sentiment analysis, How to make the score to a words like

  1. more than 5 is very positive
  2. 1 to 5 is positive
  3. 0 is neutral
  4. -1 to -5 is very negative
  5. less than 0 is negative

something like that and a nice ggplot will be very good...

i am now filling my negative and positive words, language i use is Indonesia

1 Answers1

0
library(dplyr)
library(mosaic)
emotion <- mutate(analysis, score = derivedFactor(
  "Netral" = (score == 0),
  "Sangat Positif" = (score > 5), 
  "Positif" = (score == 1 | score == 2 | score == 3 | score == 4 ),
  "Sangat Negatif" = (score < -5),
  "Negatif" = (score == -1 | score == -2 | score == -3 | score == -4),
  .method = "first",
  .default = NA
))

from post can dplyr package be used for conditional mutating?

i tried 1 <= score && score <= 4 for between 1 to 4 (or -1 to -4 ) but it's just not working...

Community
  • 1
  • 1