Enhancement for New R instance for each R metric execution?

Aug 3, 2015 at 8:35 PM
I am wondering is there a near-future plan to create a separate R instance for each RScript function execution?

I see an application case where over 100 users intend to run RScript-included reports and dashbaords concurrently. Each user has a number of preexisting RScripts and it is hard to let them modify each R script to avoid variable name conflict in the R global environment. Not practical at all. Creating a new local namespace/environment is not a good practice as well because eventually the output variables have to be in the global environment for MicroStrategy to read.
Jun 15, 2016 at 12:59 AM

Good point. You are correct that R Scripts that share the same environment can interact in unpredictable ways. This is why, when a report, document or dashboard executes in MicroStrategy, a unique R Environment is created for each metric with an R Script function.

To see this, add this command to your R Script which saves the entire R Global environment at the moment:
When you open that file (in R Gui or RStudio) and run the "ls()" command, you'll see a variable named mstr.Env.XXXXX (where XXXXX is a unique identifier string, such as wkfnqdu). When you run the ls command on that environment, you'll see all the variables from your R Script execution inside.

Hope this helps,