dependency ‘slam’ is not available when installing TM package - r

I was able to use the library(tm) in r without problem until today, when loading tm shows:
library(tm)
Loading required package: NLP
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘slam’
Error: package or namespace load failed for ‘tm’
I thought this is a dependency issue and seek to reinstall package
install.packages("tm")
Warning in install.packages : dependency ‘slam’ is not available
and then try to find slam:
install.packages("slam")
Warning in install.packages :
package ‘slam’ is not available (for R version 3.2.4)
I also tried some of the issues listed here and chooseCRANmirror(), still no luck. Is there something wrong with the package or is it just that my r does not allow 'slam' to install after today?
session info
> sessionInfo()
R version 3.2.4 (2016-03-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] NLP_0.1-9
loaded via a namespace (and not attached):
[1] parallel_3.2.4 tools_3.2.4

For R-version 3.2.3, following worked fine as mentioned in this link and it suggests this works for R-version 3.3.0 as well:
#install devtools if you have not installed
install.packages('devtools')
library(devtools)
slam_url <- "https://cran.r-project.org/src/contrib/Archive/slam/slam_0.1-37.tar.gz"
install_url(slam_url)

I found a hint at this german site about R under Install additional R packages ("Zusätzliche R-Pakete installieren")
After I installed slam seperatly over apt-get for example:
sudo apt-get install r-cran-slam
I could install tm the normal way:
install.packages('tm')
And load the library aswell.
I hope my answer helps someone.

I had the same problem as you.
Slam "Depends: R (≥ 3.3.1)", this why I had to perform the following actions to successfully install and load "tm" package:
Update R from 3.2.5 to the latest version 3.3.2
install.packages("tm")
also installing the dependencies ‘NLP’, ‘slam’
package ‘NLP’ successfully unpacked and MD5 sums checked
package ‘slam’ successfully unpacked and MD5 sums checked
package ‘tm’ successfully unpacked and MD5 sums checked
library(tm)

I used the following code to install the binary or the older version of slam. It worked for me.
install.packages("slam", type = "binary")

I had the same problem and:
I upgraded RStudio to the latest version (1.0.143)
I upgraded R to the latest version (R.3.3.3)
I rebooted Rstudio
I installed again in RStudio the package "tm"
I ran library(tm)
and everything works fine now.

The latest version of the package "slam" only works for R(>=3.4.0),so you can try either updating your R to the latest version or downloading an early version of the "slam" package.
This is a download link from CRAN for early version of "slam" package: https://cloud.r-project.org/bin/macosx/mavericks/contrib/3.3/slam_0.1-40.tgz.

Apparently the problem seems to be the version of R you are using. Try installing the latest version of R, 3.3.1. That should take care of it.

I am using R3.2.5. I was trying to install "tm". I did install NLP as a dependency but gave me an error :
"package ‘slam’ is not available (for R version 3.2.5)"
The option I had to was to download the zip/tar/gz file(binaries) from https://cran.r-project.org/web/packages/slam/index.html and install the package.
It worked for me after that. Although I am not sure what the problem is because the library information mentions it is for R (≥ 3.3.1)

I also had to upgrade to the most recent version of R.
Specifically, on Ubuntu 16.04 here are instructions to get the up to date R version.

I faced this error while installing the "tm" package on R version 3.3.0. Seems like some missing libraries. After I could install the latest version 3.4.1 , i was able to install the package "tm" which installed the 'slam' on its own. Hope this may help somebody.

Just Install NLP package with dependencies = True
Install tm packaged with dependencies = True
And things should work out:)

For Ubuntu, I installed the following two from console and then it got installed.
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install gfortran

For any such type of issue regarding package not installed, update your R and later reinstall the package. These are the steps you follow:
if(!require(installr)){ install.packages("installr")}
require(installr)} #load the package
updateR()

Related

Unable to download 'blotter' package

I'm currently running on MacOS Sierra, 10.12.6 and I'm running Rstudio Version 1.2.5033.
I'm working on a project that requires the use of the 'quantstrat' package.
I've been trying to install 'quantstrat' package using
"devtools::install_github("braverock/quantstrat")"
and I'm constantly getting this error.
"Downloading GitHub repo braverock/quantstrat#master
Skipping 1 packages not available: blotter
Installing 4 packages: blotter, FinancialInstrument, foreach, iterators
Installing packages into ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library’
(as ‘lib’ is unspecified)
Error: Failed to install 'quantstrat' from GitHub:
(converted from warning) package ‘blotter’ is not available (for R version 3.6.3)"
I've tried upgrading my version of Rstudio and find alternative sources to download 'blotter' but I'm still unable to do so.
Anyone has any idea?

package ‘gplots’ is not available for R version 3.0.2

I was using ubuntu 14.04.2 LTS. My R version was 3.0.2.
When I used the following command to install package "gplots"
sudo -i
R
install.packages("gplots")
I got a warning message: package ‘gplots’ is not available (for R version 3.0.2.) Any suggestion? Thanks.
You can try installing gpots from github cran repo.
install.packages("dplyr")
library(devtools)
install_github("cran/gplots")

Installing text mining package in R on Linux

I am using R version(3.0.1) on Linux Mint 16
When I tried downloading the tm package using
install.packages("tm")
it gives me an error saying:
package ‘tm’ is not available (for R version 3.0.1)
How can I possibly fix this?
cran page http://cran.r-project.org/web/packages/tm/index.html says : R (≥ 3.1.0).
Download the applicable old version here and then install from source:
install.packages(file_name_and_path, repos = NULL, type="source")
Reference

Installing SVGAnnotation package under R 2.15.3

I have troubles installing the SVGAnnotation package under R 2.15.3
Because this package is not available at CRAN, I downloaded version 0.93-1 from http://www.omegahat.org/SVGAnnotation/
and try to install it via
install.packages("SVGAnnotation_0.93-1.tar.gz", repos=NULL,
type="source")
Unfortunately, the following problem occurs:
Anyone has an idea how I could get it to work for R 2.15.3?
If you would like to install the most recent version, try
library(devtools)
install_github('duncantl/SVGAnnotation')

Installing Rcpp package in R 2.15.0

I have a problem installing "Rcpp" package in R. The install command have worked for all packages but not for this one. The R error is :
package ‘Rcpp’ is not available (for R version 2.15.0)
I am using windows Vista.Please help.
As can be seen on the CRAN status page for Rcpp, it now depends on R (>= 2.15.1).
So you either update R from 2.15.0 to 2.15.1 (which is not a bad idea), or you can try to install an older Rcpp version such as 0.9.10 which will work with R 2.15.0.

Resources