> library(SentimentAnalysis)

Attaching package: ‘SentimentAnalysis’

The following object is masked from ‘package:base’:

    write

> ?SentimentAnalysis
starting httpd help server ... done
> text_sen <- analyzeSentiment ("There are many useful and interesting courses and tutorials in FaraDars Website. It's awesome!")
> convertToBinaryResponse(text_sen)$SentimentQDAP
[1] positive
Levels: negative positive
> text_vec <- C("I love the Isfahan city because it is very beautiful and the place is fantastic.",
+ "That orange Fiat Multipla is the ugliest car I have ever seen.",
+ "I like this movie but would not recommend it to my friends.",
+ "Football is one of the most popular sports but some people do not like it.")
Error in C("I love the Isfahan city because it is very beautiful and the place is fantastic.",  : 
  object not interpretable as a factor
> text_vec <- c("I love the Isfahan city because it is very beautiful and the place is fantastic.",
+ "That orange Fiat Multipla is the ugliest car I have ever seen.",
+ "I like this movie but would not recommend it to my friends.",
+ "Football is one of the most popular sports but some people do not like it.")
> text_vec
[1] "I love the Isfahan city because it is very beautiful and the place is fantastic."
[2] "That orange Fiat Multipla is the ugliest car I have ever seen."                  
[3] "I like this movie but would not recommend it to my friends."                     
[4] "Football is one of the most popular sports but some people do not like it."      
> vec_sen <- analyzeSentiment (text_vec)
> vec_sen
  WordCount SentimentGI NegativityGI PositivityGI SentimentHE NegativityHE PositivityHE SentimentLM
1         6   0.5000000            0    0.5000000           0            0            0   0.3333333
2         7   0.0000000            0    0.0000000           0            0            0   0.0000000
3         4   0.5000000            0    0.5000000           0            0            0   0.2500000
4         6   0.3333333            0    0.3333333           0            0            0   0.1666667
  NegativityLM PositivityLM RatioUncertaintyLM SentimentQDAP NegativityQDAP PositivityQDAP
1            0    0.3333333                  0     0.5000000      0.0000000      0.5000000
2            0    0.0000000                  0    -0.1428571      0.1428571      0.0000000
3            0    0.2500000                  0     0.7500000      0.0000000      0.7500000
4            0    0.1666667                  0     0.3333333      0.0000000      0.3333333
> convertToBinaryResponse(vec_sen)$SentimentQDAP
[1] positive negative positive positive
Levels: negative positive
> convertToBinaryResponse(vec_sen)$SentimentLM
[1] positive positive positive positive
Levels: negative positive
> convertToBinaryResponse(vec_sen)$SentimentGI
[1] positive positive positive positive
Levels: negative positive
> convertToBinaryResponse(vec_sen)$SentimentHE
[1] positive positive positive positive
Levels: negative positive
> convertToDirection(vec_sen)$SentimentQDAP
[1] positive negative positive positive
Levels: negative neutral positive
> convertToDirection(vec_sen)$SentimentLM
[1] positive neutral  positive positive
Levels: negative neutral positive
> convertToDirection(vec_sen)$SentimentGI
[1] positive neutral  positive positive
Levels: negative neutral positive
> convertToDirection(vec_sen)$SentimentHE
[1] neutral neutral neutral neutral
Levels: negative neutral positive
> 
