MicroStrategy ONE

The R Integration Pack is no longer supported as of December 2024.

Defining an R Script's File Location and Working Directory

The R scripts for your R analytics store the R script file, error log, and other supporting files in the directories described below.

Location of the R Script File

The R script file is located in the R script's directory, as specified in the _RScriptFile parameter for the R script's metric in MicroStrategy.

If the path or R script file name listed in the _RScriptFile parameter for R does not exist or is defined with a URL, the execution of the R script will fail. An R script failure can cause different error results in MicroStrategy, depending on whether the R script is used by a stand-alone metric or a derived metric, as described here.

If the _RScriptFile parameter does not contain a path, the directory defined in the _WorkingDir parameter for R is used.

If the _RScriptFile parameter does not contain a path and an existing directory is not defined in the _WorkingDir parameter for R, the directory defined in the registry key RScriptsFolder is used.

If the directory could not be identified using the locations listed above, the default RScripts folder defined during the R Integration Pack installation is used. This is typically InstallPath\RScripts.

Location of the R script working directory

The working directory stores an error log and supporting files in the following location:

  • If a working directory is specified for R, the directory defined in the _WorkingDir parameter for R is used.
  • If a working directory is not specified for R or the specified directory does not exist, the location of the R script file is used.
  • If the directory could not be identified using the locations listed above, then the R Integration Pack installation folder is used.