Restarting R for package installation

Dear Rstudio community, Please how have you solved this problem that is consistently asking to restart R session anytime you want to install packages? I am stressed out because it takes hours when you accept to restart, then still ask you to restart again. if you click "No", packages won't install. I have been battling to install "caret", "recipes", "metrics", "explore" for days now. I AM TIRED

The codes I used:
install.packages('explore',repos = ' CRAN - Package explore')
install.packages('recipes',repos = 'http://cran.rstudio.org')
install.packages("caret")
install.packages("caret", dependencies = TRUE)
.libPaths()

  1. ERROR: lazy loading failed for package 'tidyselect'
  • removing 'C:/Users/LILIAN/Documents/R/win-library/4.0/tidyselect'
  • restoring previous 'C:/Users/LILIAN/Documents/R/win-library/4.0/tidyselect'
    Warning in install.packages :
    installation of package ‘tidyselect’ had non-zero exit status
  1. ERROR: lazy loading failed for package 'tidyselect'
  • removing 'C:/Users/LILIAN/Documents/R/win-library/4.0/tidyselect'
  • restoring previous 'C:/Users/LILIAN/Documents/R/win-library/4.0/tidyselect'
    Warning in install.packages :
    installation of package ‘tidyselect’ had non-zero exit status
    ERROR: dependency 'hardhat' is not available for package 'recipes'
  • removing 'C:/Users/LILIAN/Documents/R/win-library/4.0/recipes'
    Warning in install.packages :
    installation of package ‘recipes’ had non-zero exit status
  1. Warning in install.packages :
    package ‘explore’ is not available (for R version 4.0.0)
    Warning in install.packages :
    unable to access index for repository https://CRAN.R-project.org/package=explore/bin/windows/contrib/4.0:
    scheme not supported in URL ' https://CRAN.R-project.org/package=explore/bin/windows/contrib/4.0/PACKAGES'

  2. Execution halted
    ERROR: lazy loading failed for package 'tidyselect'

  • removing 'C:/Users/LILIAN/Documents/R/win-library/4.0/tidyselect'
  • restoring previous 'C:/Users/LILIAN/Documents/R/win-library/4.0/tidyselect'
    Warning in install.packages :
    installation of package ‘tidyselect’ had non-zero exit status
    ERROR: dependency 'hardhat' is not available for package 'recipes'
  • removing 'C:/Users/LILIAN/Documents/R/win-library/4.0/recipes'
    Warning in install.packages :
    installation of package ‘recipes’ had non-zero exit status
    The downloaded source packages are in
    C:\Users\LILIAN\AppData\Local\Temp\RtmpADNJ4T\downloaded_packages’

Note that: I have updated all the packages I have.
closed and restarted my system several times.
please help me. Thank you

Hello @Lindibe ,

I just installed the package caret on Windows 10 with 'R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid"'
I did not get any errors or suggestions for a restart.
But maybe somewhere in your installation process an error occurred (before) that now prevents a good install on your site.

Below you find a screenprint of my install. I used the "Install Packages" dialog that you see on the right.
To avoid confusion: I first used the dialog and after the install I again opened the dialog to display it on the screenprint.
I think that using 'Repository (CRAN)' for caret, as I did, uses the call

install.packages('caret',repos = 'http://cran.rstudio.org',dependencies = TRUE)

Suggestions from my side:

  • you have spent a lot of time, you say, on restarts (what do you exactly mean because a restart of R is quickly done ??) so why not install the latest version of R.
  • check if you have already installed some of the packages that my install shows you and remove them manually from the package library (in Windows and not under control of R) .

Hope this helps in some way.

Thank you @Han I did as you directed, uninstalled all the packages, updated Rstudio from 4.0.0 to 4.2.2. I've installed all the packages. I guess I'm in for a better R experience. Thank you

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.