BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MariaD
Barite | Level 11

Hi folks,

 

We are doing our first test running R through SAS EG. Is there any way to export R graph to JPG or other format? Is possible to view R graph on SAS EG?

 

Regards, 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I don't have SAS EG installed anymore because I use SAS Studio. The documentation addresses this issue, and suggests that some installations of EG might turn off R graphics. 

 

In SAS Studio, you can run the following program, which uses the png() function in R to write the R graph to a PNG. The trick is to find a location that you can write the file to. You might need to check with your SAS Administrator to find out which folders you can write to.

 

proc iml;
submit / R;
png(file="C:/temp/RGraph2.png", bg="transparent", width=640, height=480)
x <- (1:100)/10
plot(x, sin(x))
endsubmit;
quit;

View solution in original post

3 REPLIES 3
Ksharp
Super User

Calling @Rick_SAS 

Rick_SAS
SAS Super FREQ

I don't have SAS EG installed anymore because I use SAS Studio. The documentation addresses this issue, and suggests that some installations of EG might turn off R graphics. 

 

In SAS Studio, you can run the following program, which uses the png() function in R to write the R graph to a PNG. The trick is to find a location that you can write the file to. You might need to check with your SAS Administrator to find out which folders you can write to.

 

proc iml;
submit / R;
png(file="C:/temp/RGraph2.png", bg="transparent", width=640, height=480)
x <- (1:100)/10
plot(x, sin(x))
endsubmit;
quit;
MariaD
Barite | Level 11

Thanks @Ksharp , works perfect!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 990 views
  • 1 like
  • 3 in conversation