In this paper, we describe %PROC_R , a SAS macro that enables native R language to be embedded in and executed along with a SAS program in the base SAS environment under Windows OS. This macro executes a user-dened R code in batch mode by calling the unnamed pipe method within base SAS . The R textual and graphical output can be routed to the SAS output window and result viewer, respectively . Also, this macro automatically converts data between SAS datasets and R data frames such that the data and results from each statistical environment can be utilized by the other environment. The ob jective of this work is to leverage the strength of the R programming language within the SAS environment in a systematic manner. Moreover, this macro helps statistical programmers to learn a new statistical language while staying in a familiar environment.
CITATION STYLE
Wei, X. (2012). %PROC_R : A SAS Macro that Enables Native R Programming in the Base SAS Environment. Journal of Statistical Software, 46(Code Snippet 2). https://doi.org/10.18637/jss.v046.c02
Mendeley helps you to discover research relevant for your work.