Integrating with R
R is a data analysis environment created through the GNU Project. This page provides a place for Analytica users to share tricks and techniques for integrating R with Analytica models.
Calling R from an Analytica model
Running a batch job
Scenario
You need to run a particular analysis using R code and libraries, possibly running on data from generated by your Analytica model, and then you'll need to read in the results of that R analysis into Analytica.
Requirements
You'll need the Analytica Enterprise or better for this.
Basic steps
- Install the R Software for Windows (if you haven't already)
- Figure out how to perform the analysis of interest in R. Note down the list of commands you would issue in R.
- From your Analytica model, use WriteTextFile to write out the R commands that will need to be executed to a file.
- Use RunConsoleProcess to launch R.exe and run the analysis
- Use ReadTextFile to read the results
- Use FindInText, SplitText and ParseNumber to parse the results from R.
An Example
= Writing out the data and commands
Using an Analytica model from R
TBD: Would be done using ADE
Comments
Enable comment auto-refresher