Sentiment Analysis in R
Ted Kwartler
Data Dude
library(qdap)
polarity(text.var, grouping.var = NULL)
x <- c("Nicole", "Nick", "Waldo")
grep("Waldo", x)
[1] 3
grepl("Waldo", x)
[1] FALSE FALSE TRUE
!grepl("Waldo", x)
[1] TRUE TRUE FALSE
x <- c("Nicole", "Nick", "Waldo")
grepl("Waldo|Nicole", x)
[1] TRUE FALSE TRUE
!grepl("Waldo|Nicole", x)
[1] FALSE TRUE FALSE
Sentiment Analysis in R