BookmarkSubscribeRSS Feed
sascode
Quartz | Level 8
Hi,
I am interested to run some R code in sas 9.4.
I recently leant for this paper(
https://www.jstatsoft.org/article/view/v046c02)
but the provided Proc R looks to be an old version.
Although, I was able to run, I couldn't generate R plots in sas results.,
I would like to ask if another updated version of this Proc R exists?
Thanks.
4 REPLIES 4
andreas_lds
Jade | Level 19

Afaik there is no proc r in sas right know, with recent releases you can use proc iml to execute r code.

sbxkoenk
SAS Super FREQ

Hello,

 

I had never heard about PROC R.
It is probably a 3rd party procedure, to be installed on top of regular SAS, but NOT supported by SAS.

 

You can find a lot on internet about running R functions and R programs from within PROC IML (Interactive Matrix Language).

 

See for example here :

PhUSE 2011
Paper CS07
Calling R Functions from SAS
Dr. Peter Bewerunge, HMS Analytical Software, Heidelberg, Germany
https://www.lexjansen.com/phuse/2011/cs/CS07.pdf

 

It is also in the SAS DOC of course ( the below doc is from IML Studio ) :

SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation | SAS 9.4 / Viya 3.5
SAS/IML Studio for SAS/STAT Users
Calling Functions in the R Language
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/imlsstat/imlsstat_statr_toc.htm

 

SAS has a PROC PYTHON, but no PROC R 😉 .

 

Koen

Oligolas
Barite | Level 11

Hi,

This isnt' a procedure but a SAS macro that runs the R analyses in the R program to redirect the results to SAS.

Also the data is transferred with proc import/export between the environments.

The paper and the macro are 10 years old (!) but the procedures used in SAS are still available with no significant update (if any) so I'm not sure what kind of update you expect?

________________________

- Cheers -

SASKY
Calcite | Level 5
I have the same problem that the plots from R cannot show in SAS result window (but it said yes in the paper). So, I cannot use ODS to generate html, ppt, rtf file directly.
But I can output the R plot in a folder and then use "proc document" to combine them later. you can check the link here: https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsgs/n0e8nrja6xauljn1es9oq5lk1kal.htm

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1303 views
  • 3 likes
  • 5 in conversation