In some cases, you want to capture a series of R commands in a text file, and you want to execute them from Sisense (edit formula).
Write script that will handle and manipulate the arguments you send from Sisense
- Open RGui or RStudio.
- Write the script that will handle the arguments you send from Sisense, make sure you use function syntax (subprogram that returns values).
RGui script editor
RStudio script editor
- Save the script in R working directory or another path in R server machine.
Load R script commands to Sisense edit formula
- The setwd() function is setting working directory of the folder path where we saved our R script.
- The source() function instructs R to read the text file and execute its contents.
- Sisense arguments accessed to R script by calling the name of the function in the script (example line 3).
- Save function/model for future usage.
R is a general-purpose programming language, so we can use it to automate analysis and create new functions that extend the existing language features. You can capture series of R commands in a text file and execute them from Sisense.