install.packages(“tm”) -> “dependency 'slam' is not available”

后端 未结 3 1707
一生所求
一生所求 2021-01-28 08:11

I\'m trying to install the tm package on IBM\'s Data Science Experience (DSX):

install.packages(\"tm\")

However, I\'m hitting this

相关标签:
3条回答
  • 2021-01-28 08:15

    You need to install slam either by

    install.packages("slam")

    OR

    slam_url <- "https://cran.r-project.org/src/contrib/Archive/slam/slam_0.1-37.tar.gz"
    install_url(slam_url)
    
    0 讨论(0)
  • 2021-01-28 08:19

    try sudo apt-get install r-cran-slam (worked for lubuntu)

    0 讨论(0)
  • 2021-01-28 08:27

    If you try to install slam with install.packages(), then the version 0.1.40 will be used from CRAN. According to your error and the DESCRIPTION file of the library, it has the dependency on R (>= 3.3.1).

    If a older version of slam is useful for you, then you can install it from the CRAN archives. See https://cran.r-project.org/src/contrib/Archive/slam/

    According to the documentation for tm, it has a dependency on slam (≥ 0.1-31). See https://cran.r-project.org/web/packages/tm/index.html

    Previous versions have a dependency on older R versions. The following code worked for me to install slam_0.1.37 on DSX:

    library(devtools)
    install_url("https://cran.r-project.org/src/contrib/Archive/slam/slam_0.1-37.tar.gz")
    
    # test slam
    library(slam)
    a <- as.simple_sparse_array(1:3)
    a
    extend_simple_sparse_array(a, c( 0L, 1L))
    
    0 讨论(0)
提交回复
热议问题