When I try to install ggplot2 package, instead of that, colorspace package is installing.

install.packages("ggplot2")

package ‘colorspace’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\64220\AppData\Local\R\win-library\4.3’ for modifying
Try removing ‘C:\Users\64220\AppData\Local\R\win-library\4.3/00LOCK’

colorspace is a package that ggplot2 needs. It is normal for such "dependencies" to be installed. Try going to the folder C:\Users\64220\AppData\Local\R\win-library\4.3 and looking for a file named 00LOCK. Delete it if it is there.

But when I try library("ggplot2"), it shows there is no package installed. and I did check the LOCK but it's not there

ggplot2 was not installed because the installation of colorspace failed. I don't know if the 00LOCK file is a hidden file. Do you have Windows set to show hidden items? If not, turn that on in that folder and look again. To show hidden items on my Windows 10 system, I open the folder, click the View tab near the top left and select the Hidden items box that is toward the right side of the options in the ribbon.
What happens if you run install.packages("colorspace")

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.