Error install package, failed to lock directory

I am a beginner in RStudio. I try to install a package and there was an error.

package ‘rprojroot’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\mami\Documents\R\win-library\3.6’ for modifying
Try removing ‘C:\Users\mami\Documents\R\win-library\3.6/00LOCK’

What should I do to solve this error?

Follow the instructions on the error message and remove that file.

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.

What is the command to remove this path? Thank you

You don't need a command, just open the Windows file explorer, look for the file and delete it.

1 Like

I tried using this command: remove("C:\Users\mami\Documents\R\win-library\3.6/00LOCK")

and there is an error:
Warning message:
In remove("C:\Users\mami\Documents\R\win-library\3.6/00LOCK") :
object 'C:\Users\mami\Documents\R\win-library\3.6/00LOCK' not found

Can you give another suggestion?