Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. text class.negative class.positive class.trust
  2. <fctr> <dbl> <dbl> <dbl>
  3.  
  4. firmly believe... 11 24 3
  5. when i thought... 3 3 4
  6. fans of david... 11 24 12
  7. just watched... 3 5 9
  8. i was so looking... 16 9 10
  9.  
  10. clean.reviews = data.frame(text = reviews,class = get_nrc_sentiment(reviews), stringsAsFactors = T)
  11. head(clean.reviews)
  12. clean.reviews1 = as.data.frame(clean.reviews)
  13. head(clean.reviews1)
  14.  
  15. class (class.positive-class.negative) text
  16. 13 firmly believe...
  17. 0 when I thought...
  18. 13 fans of david...
  19. 2 just watched...
  20. -7 i was so looking...
  21.  
  22. library(dplyr)
  23. clean.reviews %>% mutate(class = class.positive - class.negative)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement