Issue loading library tidyverse

I keep receiving an error when trying to load library tidyverse. It says it is related to dplyr but I also installed that package. Still the error persists. I don't know how to fix it.

dplyr didn't install correctly. That's what all the black text at the top of the console in your screenshot was saying. You need to try installing it again. If that fails, go to your package library folder and delete the dplyr folder. From your pic, your package is at C:/Users/Dishina/.../win-library/4.0 (replace the "..." with the rest). After deleting it, reinstall dplyr.

I tried doing that as well. I select dplyr and delete it from C:/Users/Dishina/.../win-library/4.0... but it remains there. In R, when I click at packages, there is no such package as dplyr even after running the code install.packages("dplyr")

R has problems with package libraries set in cloud synced folders (OneDrive in your case), try setting 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 this line
R_LIBS_SITE="C:\\Program Files\\R\\R-4.0.5\\library"

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

1 Like

@andresrcs Thank you for your help. Could you please elaborate on how to remove packages from existing folder and how to set up a new one for package installation. As in what are the steps/codes for that?

Read the blog post (sorry but I can't be more detailed than that), you only need to define where you want your package library to be and then start installing packages as usual. Base R packages are already installed in the system-level package library by default.

Where do I redefine the folder where the packages will be stored other than One-drive? Does setting a directory help? I don't think it does!

Is up to you, but if I was you I would use the default system level package library.

Incompatibility of R with cloud synced folders is a know issue so setting your package library outside OneDrive could indeed help, although, since you are not providing clear information about your problem I can't be completely sure this by itself is going to solve it.

Well, if you know better than me, then I think I don't have more advice to give you.

The problem is that I keep getting this error when I try to load tidyverse. Its probably because the packages are installed in One-drive as you mentioned! I don't know how to change the location of installing packages or simply put, I don't know how to resolve this error.

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.