Warning in install.packages :
cannot create dir 'C:\Users\OneDrive\Documents\R\win-library\3.6\file8a46e1e433a', reason 'No such file or directory'
Error in install.packages : unable to create temporary directory ‘C:\Users\OneDrive\Documents\R\win-library\3.6\file8a46e1e433a’
OneDrive is networked attached in Windows? If so, try installing R to your local drive and doing install.packages(ggplot2) again. If you can't install R to a local drive because your workstation is required to use OneDrive, ask the network administrator if your permissions are correct.
NOW ITS SHOWING THIS :
library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘lifecycle’