I have been trying to install tidyverse package but it's not working somehow! I can running into warnings or errors! I tried deleting both R and Rstudio multiple times on my mac but it didn't help at all!
Warning in install.packages :
dependency ‘evaluate’ is not available
also installing the dependencies ‘knitr’, ‘rmarkdown’, ‘reprex’
There are binary versions available but the source
versions are later:
binary source needs_compilation
knitr 1.37 1.48 FALSE
rmarkdown 2.11 2.28 FALSE
reprex 2.0.1 2.1.1 FALSE
tidyverse 1.3.1 2.0.0 FALSE
ERROR: dependency ‘evaluate’ is not available for package ‘knitr’
It looks like you are installing those packages on a rather old version of R (Version 3.6 release in April 2020, the most current major R version is 4.4)
By pointing to cran.rstudio.com for R packages you will always get the latest available packages. Some of those are only available for more recent R versions (evaluate 0.24.0 is currently only available for R>=4.0.0).
There is two possible solutions:
Upgrade to a later R version (4.4 would be ideal). This would be the best option if you are interested to keep using the most recent R packages.
Set the repository to a time-based snapshot that is compatible with R version 3.6. R 4.0 was released in April 2020 so I would recommend to go with a snapshot just before that time, i.e. set options(repos="https://packagemanager.posit.co/cran/2020-03-30") before installing or use the information in Posit Package Manager that will help you to set this up. This approach would ensure that all R packages are compatible with your R version. The disadvantage is that you will only get R packages as they were available on 2020-03-30.
Both options would give you a peace of mind with other package installations you may want to install in the future.
Additional note: If you are however only interested in solving the issues with the evaluate dependency and are happy to take the risk you may hit other issues with your current setup, you also could simply use
remotes::install_github("r-lib/evaluate")
to install the latest version of evaluate from github where the authors (@hadley himself) have reinstated the compatibility to R 3.6 (cf. Restore R 3.6 compatibility (#200) · r-lib/evaluate@e00724f · GitHub). Make sure you have the remotes package installed. Once you installed evaluate this way, you can rerun the tidyverse installation.
I would consider this approach at best as a workaround - it does not solve the fundamental issue trying to run an R version from 2020 with R packages released today. Options 1 and 2 above are much cleaner IMHO with all their pro's and con's attached.