Unable to install ggplot2 package ..please help.. Im new in R

Its showing this while installing

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’

Please inform what to do

Hi, and welcome!

For future questions that involve coding, please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. This doesn't apply to your question.

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’

You are missing this package dependency, you have to install it

install.packages("lifecycle")
1 Like

Thankyou so much.
working now.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.