Error in R studio - normalizePath(path.expand(path) winslash mustwork)

@shiame I have found a solution that works for me that you might have luck with as well.

The "~" shortcut appears to be bound the first time that path.expand("~") is called and by default is set to your R_USER environment variable. I found that I did not have a R_USER so for some reason it was pulling a raw string of my document directory. I forced one to be loaded by creating a Renviron.site file in the C:\Users\%USERNAME%\AppData\Local\Programs\R\R-4.2.1\etc directory that consist of the following line, of course replacing "Company name" with yours, non-ASCII characters and all:

R_USER=C:\\Users\\%USERNAME%\\"Company name"\\Documents

R studio appears to load this path and is able to start up without the normalizePath() error as well as show me my list of packages.

1 Like