QBoard » Artificial Intelligence & ML » AI and ML - R » Facing Error in library(caret) : there is no package called ‘caret’

Facing Error in library(caret) : there is no package called ‘caret’

  • I am facing problem while downloading 'caret' package in R studios. The code below was taken from the caret documentation.

    install.packages("caret", dependencies = c("Depends", "Suggests"))
    

     

    it works fine while installing but it gives Errors and Warnings while unpacking few packages like mentioned below:

    ERROR: dependencies ‘eiPack’, ‘ei’, ‘MCMCpack’, ‘Zelig’ are not available for package ‘ZeligEI’
    * removing ‘/home/shazil/R/x86_64-pc-linux-gnu-library/3.4/ZeligEI’
    
    Warning in install.packages :
      installation of package ‘ZeligEI’ had non-zero exit status

     

    At the end when the whole installation process is finished it says:

    The downloaded source packages are in
        ‘/tmp/RtmpeiP5GO/downloaded_packages’ 

     

    After that when I use the library() command, the following Error appears

    > library(caret)
    Error in library(caret) : there is no package called ‘caret’

     

    I am using Ubuntu 16.04, Dell machine Core i5 7th Gen, 6GB RAM AMD RADEON GRAPHICS

    Would really appreciate the help as I am new to Data Science and R programming.

      November 15, 2021 12:47 PM IST
    0
  • I just did a fresh RStudio cloud session and installed caret successfully.

    A link to the project is below (there's no content, the only thing run was install.packages("caret", dependencies = TRUE):
    https://rstudio.cloud/project/42168

      December 27, 2021 1:40 PM IST
    0
  • You need to have both written:
    install.packages("caret") library(caret)
      November 16, 2021 12:37 PM IST
    0
  • You need to have both written:

    install.packages("caret")
    library(caret)
      January 10, 2022 12:31 PM IST
    0
  • I encountered similar issue when installing caret in MacOS.

    The solution was to install devtools and use it to install caret package. Since you are using Ubuntu 16.04,

    1.Please refer to this article article to install devtools package.

    2.Check the CRAN - caret package for the package URL, then run the code below:

    library(devtools)
    devtools::install_url("https://cran.r-project.org/src/contrib/caret_6.0-78.tar.gz")

    3.If step 2 does not work, alternatively, you can try to install the development version from caret GitHub repo:

    library(devtools)
    devtools::install_github('topepo/caret/pkg/caret')​

    Hope these help. Please indicate your R version if these could not work for you.

     
      November 22, 2021 12:17 PM IST
    0