07-25-2017 03:28 AM
Anaconda is a highly rated distribution in the world of Data Science and Python. You can install and run R and R Studio side by side with Python.
Question : Could anyone access R in path C:\Users\Username\Anaconda3\R from SAS/IML (there is no further subfolder for R-version) ? Although R and R Studio are running without problems there appear error messages to the effect that no R is found.
Would appreciate some comments.
07-25-2017 05:45 AM
Define the environment variable R_HOME. If the variable exists, SAS/IML will load R from the specified directory.
Note that the environment variable R_HOME must point to the root directory of the R installation and not to the "bin" subdirectory.
07-25-2017 06:15 AM
Rick : I did so (before).
From SAS Log ::
RLANG Enables SAS to execute R language statements.
ERROR: SAS could not initialize the R language interface.
ERROR: An installed version of R could not be found.
Both NOTEs are from SAS (pasted out of SAS log).
So SAS has grabbed the right locations.
My guess is that before get going there is read some kind of ini-type information that does not match.
Might be the version number of R out of the (standard) R-version subfolder that does not exist here.
07-25-2017 08:50 AM
OK. I've never used Anaconda. It's possible that the directory structure is different from the CRAN standard. Officially, the CRAN installation is the only configuration that SAS supports, but I will ask around to see if anyone has experience with using the version of R that is distributed with Anaconda.
Software is not usually installed in a user's profile. Was "C:\Users\Username\Anaconda3" the suggested location for the install, or did you override the default?
I assume that you are running a 64-bit version of SAS on the same desktop PC?
07-25-2017 10:00 AM
I assume that you are running a 64-bit version of SAS on the same desktop PC? :: YES.
Software is not usually installed in a user's profile. Was "C:\Users\Username\Anaconda3" the suggested location for the install, or did you override the default? :: This was suggested by the Anaconda Installer and accepted.
07-25-2017 09:24 AM
Anaconda is an IDE for Python. For R, I thought it used RStudio, an IDE for R. You need to point SAS to your actual R installation. It's usually in its own folder under Programs. I can double check my set up when I get into the office later.
07-25-2017 10:05 AM
At present R and the R dll are at these places, not in C:\Programs , but running fine ::
Because of the huge bulk I wanted to avoid a doubled installation, say on C: and on G:
07-25-2017 10:55 AM
I'm assuming you're installing under 'username' because you don't have admin privileges on your computer? If so, are you sure the environmental variables exist.
Anyways, I don't have R installed in the Anaconda folder at all, it's under C:\Programs, Python is installed in the Anaconda folder.
07-25-2017 12:12 PM
I chose this location because it was suggested by the Anaconda Installer and I accepted. I guess the reason is to make the whole handling more hassle-free (remove troubles when Install as Admin was forgotten or users don't have Admin rights).
I checked and SAS as well as Windows see the R_HOME exactly where it physically resides.
07-25-2017 12:40 PM
Did you add the RLANG option to your Config file or invocation? :: YES .
Being confirmed by : proc options option= RLANG ; run ;
I guess I'll take your word for it. Note that I didn't have to set the R_HOME settings, in fact it didn't work when I directed it to the R folder. If I put the path including the version it does work.
I DIDN'T DO THIS AND IT WORKED.
options set=R_HOME='C:\Program Files\R\' ; %put %sysget(R_HOME) ;
I DID DO THIS AND IT WORKED:
options set=R_HOME='C:\Program Files\R\R-3.3.2' ; %put %sysget(R_HOME) ;
07-25-2017 12:59 PM
You have two folders and I (thanks to Anaconda) have one. The starting of SAS/IML to R seems to be internally programmed as to requiring two folders may be even the second one containing a version number of R.
Is this correct ?
If so I see 3 ways :
1. To convince SAS to work in the one-folder scenario, too.
2. To convince Anaconda to go to a two-folder scenario.
3. To make a second R-installation on my PC just for SAS --> R.
Would you agree ? Or do you see a 4.th option ?
07-25-2017 01:06 PM
I would add the version to the R folder - this seems to be standard, not sure why Anaconda dropped the version number, update the R_HOME and I would expect both SAS and Anaconda to work at that point. I think Anaconda also works off R_HOME.