How to fix library error?.. (First time user)

Hi everyone! I am new to R and today is literally my first day opening the program. As I was trying to download ggplot2, this error appears..
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/Users/chung/OneDrive/??": The filename, directory name, or volume label syntax is incorrect

Not sure how to fix it.. Any advice will be super helpful! Thanks!

R has known problems with cloud synced folders (OneDrive in your case) and non-ASCII characters in the package library path. I would recommend setting your package library in a non-synced folder with ASCII characters only.

You can change the default library folder by setting your R_LIBS_SITE environmental variable in 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.2\\library"

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

Hi andresrcs! Thanks so much for your reply and your code does work!
The problem is.. when I close R studio and log back in, it goes back to my original situation, so I have to re-run your code every time I open R studio. Is this what's supposed to happen?

That code is to be included in a startup file, so it gets automatically executed every time you start an R session, not to be run in the R console.

For more details, please read the blog post I linked for you.

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.