@Visiting wrote:
It is close to get it work, thank you!
But I got an error: "The RLANG system option must be specified in the SAS configuration file or on the SAS invocation command line to enable the submission of R language statements".
How can I solve this issue?
Suggest you read the info under the links provided. For example under the one already shared earlier it clearly states:
Thank you remind me! I noticed that, but I use SAS EG, it is in cloud server, R is not installed there, probably that is why sample code doesn't work.
In that case the administrator of your SAS cloud platform needs to add the RLANG option. This is not something you can do.
SAS supports importing dataframes. So instead of using write.RData(), just import the dataframe directly:
proc iml;
submit / R;
library(datasets)
test<- mtcars
endsubmit;
call ImportDataSetFromR("MySASData", "test");
quit;
proc print data=MySASData; run;
@Rick_SAS wrote:
SAS supports importing dataframes. So instead of using write.RData(), just import the dataframe directly:
proc iml; submit / R; library(datasets) test<- mtcars endsubmit; call ImportDataSetFromR("MySASData", "test"); quit; proc print data=MySASData; run;
The requestor said they already have a disk file (Rdata file). Is that the same thing as a data frame? Or could it contain some other type of R object? If what was saved in the Rdata file is not a data frame can you still use that same call routine? Or would they first need to run some R code to convert the object into a dataframe?
RData files can store multiple R objects. But SAS can import only data frames, which are rectangular and are analogous to SAS data sets. This is documented at
SAS Help Center: IMPORTDATASETFROMR Call
and
SAS Help Center: Transferring Data between SAS and R Software
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!