pjj
pjj

Reputation: 2135

Which runtime is getting referenced

I have installed R at following location C:\E_Drive\ProgramFiles\R-3.4.3, so I think R environment installed at C:\E_Drive\ProgramFiles\R-3.4.3 will be used when I run the R console, right? Please correct me if I am wrong.

Now, I install a package using the R console.

Now, I download and install RStudio and from the R console of RStudio if I check whether that package is available or not then I see that it is available. I am wondering, how RStudio's R console reported that package is available, I didn't expect that since C:\E_Drive\ProgramFiles\R-3.4.3 is not on my PATH and in no way is linked RStudio with C:\E_Drive\ProgramFiles\R-3.4.3, so I thought RStudio would be referring its own R environment.

Can you please help me understand how my RStudio is referencing the C:\E_Drive\ProgramFiles\R-3.4.3 R environment.

Upvotes: 0

Views: 34

Answers (1)

user2554330
user2554330

Reputation: 44977

R normally installs packages in the same directory tree as its own binary, but it can also install them elsewhere. On Windows, this generally happens because regular users often don't have write permission in the Program Files directory. The standard Windows installer also records R's location in the registry, so that it doesn't need to be on the PATH to be found by RStudio.

You can find out where Windows or RStudio found R by running R.home() within R. You can find out where R is finding packages in a particular session by running .libPaths().

Upvotes: 1

Related Questions