I installed r studio with anaconda, and I wanted to install tidyverse library with "install.packages("tidyverse",dependencies = TRUE)" command. but I got below error. could you please help me????
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'lifecycle'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'broom'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/broom'
Warning in install.packages :
installation of package ‘broom’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'tidyselect'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/tidyselect'
Warning in install.packages :
installation of package ‘tidyselect’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'scales'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/scales'
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'forcats'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/forcats'
Warning in install.packages :
installation of package ‘forcats’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'hms'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/hms'
Warning in install.packages :
installation of package ‘hms’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'pillar'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/pillar'
Warning in install.packages :
installation of package ‘pillar’ had non-zero exit status
ERROR: dependencies 'callr', 'lifecycle' are not available for package 'reprex'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/reprex'
Warning in install.packages :
installation of package ‘reprex’ had non-zero exit status
ERROR: dependency 'lifecycle' is not available for package 'rvest'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/rvest'
Warning in install.packages :
installation of package ‘rvest’ had non-zero exit status
ERROR: dependencies 'lifecycle', 'pillar', 'tidyselect' are not available for package 'dbplyr'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/dbplyr'
Warning in install.packages :
installation of package ‘dbplyr’ had non-zero exit status
ERROR: dependencies 'lifecycle', 'tidyselect' are not available for package 'dtplyr'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/dtplyr'
Warning in install.packages :
installation of package ‘dtplyr’ had non-zero exit status
ERROR: dependencies 'lifecycle', 'scales' are not available for package 'ggplot2'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/ggplot2'
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependencies 'gargle', 'lifecycle', 'pillar' are not available for package 'googledrive'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/googledrive'
Warning in install.packages :
installation of package ‘googledrive’ had non-zero exit status
ERROR: dependencies 'broom', 'tidyselect' are not available for package 'modelr'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/modelr'
Warning in install.packages :
installation of package ‘modelr’ had non-zero exit status
ERROR: dependencies 'gargle', 'googledrive' are not available for package 'googlesheets4'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/googlesheets4'
Warning in install.packages :
installation of package ‘googlesheets4’ had non-zero exit status
ERROR: dependencies 'broom', 'dbplyr', 'dtplyr', 'forcats', 'ggplot2', 'googledrive', 'googlesheets4', 'hms', 'modelr', 'pillar', 'reprex', 'rvest' are not available for package 'tidyverse'
* removing 'C:/ProgramData/Anaconda3/envs/rstudio/lib/R/library/tidyverse'
Warning in install.packages :
installation of package ‘tidyverse’ had non-zero exit status
Using RStudio trough Anaconda is not officially supported so it doesn't offer a seamless experience. It is very common to have problems installing packages from CRAN on this scenario, when using Anaconda is safer to stick with installing packages using conda commands or the Anaconda Navigator graphical interface.
Although, if you are going to be using more R than Python I would strongly recommend installing R and RStudio as stand alone versions instead of the Anaconda versions.
It seems that the 'lifecycle' package is missing from your R environment. This package is a dependency for several other packages, including broom, tidyselect, scales, forcats, hms, pillar, reprex, rvest, dbplyr, dtplyr, ggplot2, and googledrive.
You can try installing the 'lifecycle' package first, and then re-run the command to install the tidyverse package.
You can install the 'lifecycle' package by running the following command:
install.packages("lifecycle")
If that doesn't work, you can also try installing the package directly from CRAN.