InstallR
InstallR[opts]
starts up the R runtime and connects to it.
Details and Options
- InstallR must be called before any work can be done with the RLink.
- The following options can be given:
-
"JRELocation" Automatic path to a custom Java Runtime Environment (JRE) "RCommandLine" Automatic list of strings starting with "--" and representing command-line arguments for R "RHomeLocation" Automatic location of the root of an external R distribution (currently Windows only) "AddToRDataTypePath" None list of directories with external data type definitions "ConfigureAutomatically" True enables automatic configuration of the R distribution upon the first use "RVersion" Automatic version of the R system to connect to; must be a string "JRINativeLibraryLocation" Automatic path to the folder containing the native JRI library compatible with the given external R distribution - If the "RHomeLocation" option is not set, InstallR will ignore possible settings of options "JRINativeLibraryLocation" and "RVersion" and attempt to use the last R distribution to which it has successfully connected. If either no such connection took place or the current connection attempt fails, it will search for all available R distributions and try connecting to each of them in turn until a successful connection is established. If InstallR fails to connect to any of the found R distributions or if none were found, it returns $Failed, with an appropriate error message.
- If "RHomeLocation" is set to a specific location, this enables RLink to use an external R distribution, where the specified location should correspond to the setting of the R_HOME variable (which points at the root of the R distribution).
- If the R runtime has already been installed, InstallR does nothing when called with the same value of the "RHomeLocation" option and issues a warning message if that value points to a different R distribution than the one currently in use. In either case, it keeps running the current active R session.
- RLink searches in directories specified with "AddToRDataTypePath" for external data type definitions, which are user-defined data types extending core RLink type system. When found, such definitions are loaded by InstallR and registered with RLink.
Examples
Basic Examples (1)
This configures RLink and installs the R runtime:
This automatically configures RLink and connects to an external R runtime/distribution, identified by its home directory:
Uninstall R to end the RLink session:
This configures RLink and connects to an external R runtime/distribution, passing the options "RVersion" and "JRINativeLibraryLocation" explicitly (which may be required in certain cases when RLink is unable to infer these parameters automatically):
Text
Wolfram Research (2012), InstallR, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/InstallR.html.
CMS
Wolfram Language. 2012. "InstallR." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/InstallR.html.
APA
Wolfram Language. (2012). InstallR. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/RLink/ref/InstallR.html