Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 903
data9 Avatar asked Dec 21 '15 17:12

data9


People also ask

How do you do a tilde in R?

You can use the tilde operator (~) in R to separate the left hand side of an equation from the right hand side. This operator is most commonly used with the lm() function in R, which is used to fit linear regression models. The variable name on the left side of the tilde operator (y) represents the response variable.

What does the tilde symbol mean in R?

Description. Tilde is used to separate the left- and right-hand sides in a model formula.


1 Answers

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

like image 72
TARehman Avatar answered Oct 27 '22 00:10

TARehman