Setup Considerations

Installing R

IML Studio is not distributed with a copy of R. You can download R from the Comprehensive R Archive Network website:

http://cran.r-project.org

IMPORTANT: If you are using IML Studio on a 32-bit edition of Windows, you must install the 32-bit edition of R.
If you are using IML Studio on a 64-bit edition of Windows, you can install either the 32-bit or the 64-bit edition of R. The 32-bit edition of IML Studio looks first for the 32-bit edition of R and then for the 64-bit edition. The 64-bit edition of IML Studio looks first for the 64-bit edition of R and then for the 32-bit edition.

As of August 2017, IML Studio has been verified to operate correctly with versions of R from 2.13.0 through 3.4.1. When a new version of R is released, SAS tests IML Studio with that new version. To learn whether a new version of R is compatible with IML Studio, refer to the following web page:

http://blogs.sas.com/content/iml/2013/09/16/what-versions-of-r-are-supported-by-sas.html

How IML Studio Finds R

IML Studio delays loading R until an IMLPlus program requires access to it. When IML Studio needs to load R, it follows the standard steps for finding R on a Windows computer:

  1. Lookup the environment variable R_HOME. If the variable exists, load R from the specified directory.

    Note that the environment variable R_HOME must point to the root directory of the R installation and not to the "bin" subdirectory.

  2. If the environment variable R_HOME does not exist, lookup the InstallPath value in the Windows registry under the following key:
    HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R64 64-bit editions of R
    HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R32 32-bit editions of R
    HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R older 32-bit editions of R

    If the InstallPath value exists, load R from the specified directory.

  3. If the InstallPath value does not exist, display an error message stating that R could not be found.
Testing Your Setup

To test that your computer is able to run IMLPlus programs that make use of R, run the following short IMLPlus program:

submit / R;
x <- 1:5
x
endsubmit;

It should produce the following output:

[1] 1 2 3 4 5
Sample Programs

IML Studio is distributed with a number of sample programs that demonstrate how you can use R within your IMLPlus programs. These programs are located in the directory "Programs\Samples\R" beneath the IML Studio directory.