Cannot start an interactive R session from the command line - window 10

I cannot start an R session from the command line by typing "R" even though

C:/Program Files/R

and

C:/Program Files/R/R-3.3.2/bin

in the variables "Path" (System) and "PATH" (User) (the last directory is where the actual application is located, I just tried everything by adding the first).

If I manually change the working directory to C:/Program Files/R/R-3.3.2/binand type R, the session will be started.

Clarify why this could be so? Other programs, such as Python 3, work fine if an environment variable is set, why not use R?

This question is part of a larger problem when I try to get it rpy2, but although it is successfully installed, none of its basic functions work, and I thought it could be due to the version Rinstalled on C:/Users/Anaconda2/R(because this directory was in the Path) . The application Rinstalled here will not work when opened, but the directory was returned when I typed R RHOMEin cmd - despite the fact that this installation did not even work, and apparently it only existed since I installed the rpy2pair hours ago. I assumed that rpy2trying to use the instance of R installed here, and not the usual one, which causes an error when called robjects.r. But that still doesn’t explain why I cannot start Rfrom cmd. UsingR.home(component = "home")from inside an R session (in or out of RStudio), it returns my regular working directory Rto C:/PROGRA~1/R/R-33~1.2. By moving the R file tree installed in the Anaconda directory somewhere not in Path, I was hoping that Windows would find the correct installation via Path, but instead I just get it Failed to create process.

My last assumption was that Windows did not like the space in the "Program Files", but many variables in Path go through the same folder. Any ideas?

I use:

Windows 10, R 3.3.2, Python 2.17.13

UPDATE, DECISION:

In the recommendation of Josh O'Brien (thanks!), I typed where Rin cmd, returning:

C:\Users\charl\Anaconda2\Scripts\R.exe
C:\Program Files\R\R-3.3.2\bin\R.exe

C:\Users\charl\Anaconda2\R, ( ), R.exe. R, , R, , , . R.exe ( Path), Typing R cmd R , . R.home() .

; R Anaconda rpy2 , ? , , rpy2 ( Windows, ) R - /,

+4

Source: https://habr.com/ru/post/1668042/


All Articles