I am unable to install packages in R

Hello!
I am trying to install a R package.

When I try: install.packages("shinyBS")
I get the error:
package ‘shinyBS’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\xxxxx\OneDrive\Documents\R\win-library\3.6’ for modifying
Try removing ‘C:\Users\xxxxx\OneDrive\Documents\R\win-library\3.6/00LOCK’

How can I solve it?

Delete the file indicated in the message and try again.

1 Like

Hy there I have the same problem, Ive update R and Rstudio and the problem is still running, it happen with all packages Im trying to install, although packages for default as MASS has no problem. It looks like they are installed, because this packages appear in the packages panel, but for example library(ggplot2) bring this message:

Error: package or namespace load failed for ‘ggplot2’ in get(Info[i, 1], envir = env): no fue posible abrir el archivo 'C:/Users/Martín/Documents/R/win-library/4.0/rlang/R/rlang.rdb': No such file or directory

@martin.R thank you for your answer.

I solved the problem using:

.libPaths( "C:/Users/xxxxx/OneDrive/Documents/R/win-library/3.6/00LOCK" )
install.packages("shinyBS", lib="C:/Users/xxxxx/OneDrive/Documents/R/win-library/3.6/00LOCK")

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