Calling Functions in the R Language

Overview of Calling Functions in the R Language

R is a freely available language and environment for statistical computing and graphics. Like the SAS/IML language, the R language has features suitable for developers of statistical algorithms: the ability to manipulate matrices and vectors, a large number of built-in functions for computing statistical quantities, and the capability to extend the basic function library by writing user-defined functions. There are also a large number of user-contributed packages in R that implement specialized computations.

This chapter shows you how to call R functions from PROC IML by using the SUBMIT and ENDSUBMIT statements.

This chapter describes how to configure the SAS system so that you can call functions in the R language. The chapter also describes how to do the following:

  • transfer data to R

  • call R functions from PROC IML

  • transfer the results from R to a number of SAS data structures

You cannot call R from the free SAS University Edition. The SAS University Edition runs on a virtual machine that does not have R installed.

The iml action supports the SUBMIT statement. However, it only supports submitting CASL statements by using the CASL option. The action does not support submitting R statements.

Last updated: July 20, 2026