SentimentAnalysis package

Hello guys, please can anyone help me with this problem I have. I have downloaded and installed the "SentimentAnalysis" package in R Studio from CRAN. But, when I try to load the package, using library(), I get an error message. Below is what always happens when I try to load the package:

library("SentimentAnalysis")
Error in library("SentimentAnalysis") : 
  there is no package called ‘SentimentAnalysis’

Is there something I am missing in my RStudio, which has not allowed the package to be installed? I see the package's zip file in my computer files - I use a windows computer.
When I try to install the package again, I always get the following message:

 install.packages("SentimentAnalysis")
Warning in install.packages :
  dependency ‘slam’ is not available
also installing the dependency ‘tm’


  There are binary versions available but the source versions are
  later:
                  binary source needs_compilation
tm                 0.7-3  0.7-6              TRUE
SentimentAnalysis  1.3-2  1.3-3             FALSE

Do you want to install from sources the package which needs compilation?
y/n: y
installing the source packages ‘tm’, ‘SentimentAnalysis’

trying URL 'https://cran.rstudio.com/src/contrib/tm_0.7-6.tar.gz'
Content type 'application/x-gzip' length 508463 bytes (496 KB)
downloaded 496 KB

trying URL 'https://cran.rstudio.com/src/contrib/SentimentAnalysis_1.3-3.tar.gz'
Content type 'application/x-gzip' length 126008 bytes (123 KB)
downloaded 123 KB

ERROR: dependency 'slam' is not available for package 'tm'
* removing 'C:/Users/Idiaye/Documents/R/R-3.3.0/library/tm'
Warning in install.packages :
  running command '"C:/Users/Idiaye/DOCUME~1/R/R-33~1.0/bin/i386/R" CMD INSTALL -l "C:\Users\Idiaye\Documents\R\R-3.3.0\library" C:\Users\Idiaye\AppData\Local\Temp\RtmpchThfM/downloaded_packages/tm_0.7-6.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘tm’ had non-zero exit status
ERROR: dependency 'tm' is not available for package 'SentimentAnalysis'
* removing 'C:/Users/Idiaye/Documents/R/R-3.3.0/library/SentimentAnalysis'
Warning in install.packages :
  running command '"C:/Users/Idiaye/DOCUME~1/R/R-33~1.0/bin/i386/R" CMD INSTALL -l "C:\Users\Idiaye\Documents\R\R-3.3.0\library" C:\Users\Idiaye\AppData\Local\Temp\RtmpchThfM/downloaded_packages/SentimentAnalysis_1.3-3.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘SentimentAnalysis’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\Idiaye\AppData\Local\Temp\RtmpchThfM\downloaded_packages’
>

The error message is giving you a clue, you have to install the missing dependency slam, the problem is that this package requires R >= 3.4.0 and apparently you are using 3.3 version, so you have to update R in order to being able to install this package.

Thanks a lot. I will update my R Studio and try to install slam

You have to update R not RStudio, they are two different pieces of software.

But how does that affect sentiment analysis in R Studio? I wish to carry out sentiment analysis in R Studio not R

Take a look at this thread to learn how R and RStudio relate to each other

Thanks a lot Mishabalyasin, It is very helpful.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.