Published by the Foundation for Open Access Statistics Editors-in-chief: Bettina Grün, Torsten Hothorn, Edzer Pebesma, Achim Zeileis    ISSN 1548-7660; CODEN JSSOBK
Authors: Xin Wei
Title: %PROC_R: A SAS Macro that Enables Native R Programming in the Base SAS Environment
Abstract: 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-defined 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 objective 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.

Page views:: 22495. Submitted: 2011-05-17. Published: 2012-01-25.
Paper: %PROC_R: A SAS Macro that Enables Native R Programming in the Base SAS Environment     Download PDF (Downloads: 23168)
Supplements: SAS source code Download (Downloads: 5992; 8KB) Replication code and instructions Download (Downloads: 3854; 312KB)

DOI: 10.18637/jss.v046.c02

This work is licensed under the licenses
Paper: Creative Commons Attribution 3.0 Unported License
Code: GNU General Public License (at least one of version 2 or version 3) or a GPL-compatible license.