Statistical programming, matrix languages, and more

Calling R Language Statement from SAS IML

Accepted Solution Solved
Reply
Regular Contributor
Posts: 195
Accepted Solution

Calling R Language Statement from SAS IML

Hi All,

 

I am trying to call R language statement by using "PROC IML" in Base SAS 9.4...

 

I have SAS IML Studio 14.1, SAS/IML 14.1 and R 3.2.2/R 3.2.3 and also set the following in configration file of SAS...

 

-RLANG
-SET R_HOME "<C:\Program Files\R\R-3.2.2>"

 

Still I am getting following error in Base SAS...

 

ERROR: SAS could not initialize the R language interface.
ERROR: An installed version of R could not be found.

 

When I tried to call R language statement in SAS IML Studio, it works fine...

 

I need to call R from Base SAS Proc IML not from SAS IML Studio...

 

Thanks in Advance!!!!!

 

-Urvish 


Accepted Solutions
Solution
‎02-26-2016 10:57 PM
SAS Super FREQ
Posts: 3,416

Re: Calling R Language Statement from SAS IML

You almost never have to define R_HOME if you install R in a standard place. In fact, I think the SAS/IML documentation for calling R. doesn't even mention it.

 

Remove the refernce to R_HOME.  If you need it, I believe that the correct syntax does not contain the angle brackets; just use  "C:\Program Files\R\R-3.2.2"

View solution in original post


All Replies
Solution
‎02-26-2016 10:57 PM
SAS Super FREQ
Posts: 3,416

Re: Calling R Language Statement from SAS IML

You almost never have to define R_HOME if you install R in a standard place. In fact, I think the SAS/IML documentation for calling R. doesn't even mention it.

 

Remove the refernce to R_HOME.  If you need it, I believe that the correct syntax does not contain the angle brackets; just use  "C:\Program Files\R\R-3.2.2"

Regular Contributor
Posts: 195

Re: Calling R Language Statement from SAS IML

Hi Rick,

 

Thanks for the quick response...I just removed it and it is working fine now...Do you think we can use SAS Language within the R Interface...I whould like to use SAS Language within SUBMIT and ENDSUBMIT block while using R language...

 

Thanks again!!!

 

SAS Super FREQ
Posts: 3,416

Re: Calling R Language Statement from SAS IML

Yes, you can call SAS procedures and R functions in the same program. That is Advantage #4 on the list of "Twelve advantages to calling R from the SAS/IML language"

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 420 views
  • 0 likes
  • 2 in conversation