# How to Make 3-D Graphics from SAS Data

- Author: DavidMSmith
- Published: 2011-04-27
- Canonical: https://www.smartdatacollective.com/how-make-3-d-graphics-sas-data/

The blog *SAS Analysis* shows how to create 3-D images from SAS data ... using R:

Some SAS programmers like to use SAS/IML to call R’s functions [[Ref. 2](http://support.sas.com/resources/papers/proceedings11/157-2011.pdf)]. However, it seems that SAS/IML fails to work with the latest versions of R since 2.12 [[Ref. 3](http://listserv.uga.edu/cgi-bin/wa?A2=ind1104b&L=sas-l&H=1&P=15848)]. Others tend to play tricks to call R into SAS’s data step to meet their daily needs [Ref. 4]. In this post, the macro below would call the ‘lattice’ package of R in SAS, on a PC platform, to draw paneled three dimension images, since currently SAS’s SG procedures don’t own such an option.

Essentially, the SAS Macro writes an R script which in turn calls the cloud function in R, creating this image from the sashelp.cars dataset in SAS:

[](http://revolution-computing.typepad.com/.a/6a010534b1db25970b01538e29af26970b-pi)

SAS Analysis: A macro calls R in SAS for paneled 3d plotting

