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 September 2016, IML Studio has been verified to operate correctly with the following versions of R:

Version Release Date
2.13.0 April 2011
2.13.1 July 2011
2.13.2 September 2011
2.14.0 November 2011
2.14.1 December 2011
2.14.2 February 2012
2.15.0 March 2012
2.15.1 June 2012
2.15.2 October 2012
2.15.3 March 2013
3.0.0 April 2013
3.0.1 May 2013
3.0.2 September 2013
3.0.3 March 2014
3.1.0 April 2014
3.1.1 July 2014
3.1.2 October 2014
3.1.3 March 2015
3.2.0 April 2015
3.2.1 June 2015
3.2.2 August 2015
3.2.3 December 2015
3.2.4 March 2016
3.2.5 April 2016
3.3.0 May 2016
3.3.1 June 2016

When a new version of R is released, SAS tests IML Studio with that new version. If you have a newer version of R than those listed in the table above, please contact SAS Technical Support to learn whether the new version is compatible with IML Studio.

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.