Calling Functions in the R Language |
Transfer from a SAS Source to an R Destination |
Table 11.1 summarizes the subroutines that copy data from a SAS source to an R destination. For more information, see the section Details of Data Transfer.
Subroutine |
SAS Source |
R Destination |
---|---|---|
SAS data set |
R data frame |
|
SAS/IML matrix |
R matrix |
As a simple example, the following program transfers a data set from the Sashelp libref into an R data frame named df. The program then submits an R statement that displays the names of the variables in the data frame.
proc iml; run ExportDataSetToR("Sashelp.Class", "df" ); submit / R; names(df); endsubmit;
The R names function produces the output shown in Figure 11.2.
Copyright © SAS Institute, Inc. All Rights Reserved.