rtilde-expansion

Tilde "~" expression not functioning in "R"?


The tilde expression is not working on my RStudio! I am using a windows 10 OS.

Update : After looking more carefully(thanks to Dason) It seems the "~" is pointing to "user/Documents/" rather then "user/". is there any work around?

Image

Any help?


Solution

  • The home directory in Windows R is set using the environment variable R_USER Set this using Windows (search from the Start Menu for "environment variable"). Whatever you set this to will become what R uses for ~. I have mine set to C:\Users\trehman\R.

    Here is how mine looks.

    enter image description here