Note that Anaconda has no issues working with the 'two folder' structure and having R located in the Program Files folder.
Reeza :
I start with SAS -- R . All parts have been checked and work.
Windows Environment variable R_HOME is correctly set.
proc options option= RLANG ; run ;
options set=R_HOME='C:\Users\Username\Anaconda3\R' ;
%put %sysget(R_HOME) ;
filename envcmd pipe 'set' lrecl=1024;
data WORK.Win10_Env_set;
infile envcmd dlm='=' missover;
length name $ 32 value $ 1024;
input name $ value $;
run;
/* If you get a matrix 14, 32, 50 as the result, then it's OK */
proc iml;
submit/R;
rx <- matrix( 1:3, nrow=1)
rm <- matrix( 1:9, nrow=3, byrow=TRUE)
rq <- rm %*% t(rx)
print(rq)
endsubmit;
quit;
proc iml;
/* Comparison of matrix operations in IML and R */
print "---------- SAS/IML Results -----------------";
x = 1:3; /* vector of sequence 1,2,3 */
m = {1 2 3, 4 5 6, 7 8 9}; /* 3 x 3 matrix */
q = m * t(x); /* matrix multiplication */
print q;
print "------------- R Results --------------------";
submit / R;
rx <- matrix( 1:3, nrow=1) # vector of sequence 1,2,3
rm <- matrix( 1:9, nrow=3, byrow=TRUE) # 3 x 3 matrix
rq <- rm %*% t(rx) # matrix multiplication
print(rq)
endsubmit;
Looks to me like to get Anaconda to work you need to set the same environment variable R_HOME as SAS needs to work.
http://www.swegler.com/becky/blog/2014/08/03/ipython-ipython-notebook-anaconda-and-r-rpy2/
My colleague installed Anaconda this afternoon and got SAS/IML to work with it. Here's what he did:
Here is what my colleague did to get SAS to work:
Appending the DLL directory to the PATH environment variable seems to be the step that most people would not know to do. Do Steps (1) and (2) before launching SAS
Disclaimer: we did this on one machine. We did not test the installation extensively. This is not a version of R that SAS officially supports.
I hope this information will be useful to someone. Your installation directories might vary.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.