I was trying to install ggplot2 using
install.packages("remotes")
remotes::install_github("tidyverse/ggplot2")
But it showed an error like below:
* installing *source* package 'ggplot2' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'lifecycle' 1.0.1 is already loaded, but > 1.0.1 is required
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/DELL/Documents/R/win-library/4.0/ggplot2'
* restoring previous 'C:/Users/DELL/Documents/R/win-library/4.0/ggplot2'
Warning messages:
1: In i.p(...) :
installation of package ‘C:/Users/DELL/AppData/Local/Temp/Rtmpwz3LnK/file7a81cf665c5/lifecycle_1.0.2.9000.tar.gz’ had non-zero exit status
2: In i.p(...) :
installation of package ‘C:/Users/DELL/AppData/Local/Temp/Rtmpwz3LnK/file7a86b146f40/ggplot2_3.3.6.9000.tar.gz’ had non-zero exit status
>
Please give me suggestions.