I'm very confused as to why I'm getting this error code... when I go to use ggplot it says it can't find the function but I think this is down to the tidyverse error:
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
namespace ‘lifecycle’ 1.0.0 is being loaded, but >= 1.0.1 is required
In addition: Warning message:
package ‘tidyverse’ was built under R version 4.0.5
Thanks for your reply... I think I made it worse.
I used the code:
remove.packages("tidyverse")
In hopes I could reinstall it but I tried and it just keeps giving an error saying there isn't a package called tidyverse.
I tried the code you suggested just before doing the above and it didn't change anything.
> install.packages("lifecycle")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/hbare/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘cli’, ‘rlang’
There are binary versions available but the
source versions are later:
binary source needs_compilation
cli 3.2.0 3.4.1 TRUE
rlang 1.0.2 1.0.6 TRUE
lifecycle 1.0.1 1.0.3 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/cli_3.2.0.zip'
Content type 'application/zip' length 1255499 bytes (1.2 MB)
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_1.0.2.zip'
Content type 'application/zip' length 1718546 bytes (1.6 MB)
downloaded 1.6 MB
package ‘cli’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\hbare\AppData\Local\Temp\RtmpsR5MEH\downloaded_packages
installing the source package ‘lifecycle’
trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.3.tar.gz'
Content type 'application/x-gzip' length 106854 bytes (104 KB)
downloaded 104 KB
* installing *source* package 'lifecycle' ...
** package 'lifecycle' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.6 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'lifecycle'
* removing 'C:/Users/hbare/Documents/R/win-library/4.0/lifecycle'
* restoring previous 'C:/Users/hbare/Documents/R/win-library/4.0/lifecycle'
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\hbare\AppData\Local\Temp\RtmpsR5MEH\downloaded_packages’
>
Ok, the problem is that lifecycle requires a newer version of rlang but it is only available as source code that requires compilation. You can either install RTools40 in your system so you can compile packages from source or update your R version so you can get access to precompiled binaries of the latest package versions.