Error in gzfile(file, "rb") : cannot open the connection

Hi All

I am not able to update readxl package.Can anyone please help?

Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file 'C:/Users/RAHSIN/OneDrive - RRA/R/win-library/4.0/renv/Meta/package.rds', probable reason 'Invalid argument'
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\RAHSIN\OneDrive - RRA\R\win-library\4.0’ for modifying
Try removing ‘C:\Users\RAHSIN\OneDrive - RRA\R\win-library\4.0/00LOCK’
There were 50 or more warnings (use warnings() to see the first 50)
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file 'C:/Users/RAHSIN/OneDrive - RRA/R/win-library/4.0/knitr/Meta/package.rds', probable reason 'Invalid argument'

R has problems with cloud synced folders (OneDrive in your case), to avoid this problem I recommend you to set your package library in a non synced folder.

You can change the default library folder by setting your R_LIBS_SITE environmental variable on a .Reviron or .Rprofile file. For example:

# In a .Renviron file you can set it by adding a line like this one with the desired location 
R_LIBS_SITE="C:\\Program Files\\R\\R-4.1.1\\library"

For a more detailed explanation, you can read this blog post

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.