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?