Integrating with R

Revision as of 20:45, 19 July 2012 by Lchrisman (talk | contribs) (Created page with "[http://www.r-project.org R] is a data analysis environment created through the [http://www.gnu.org GNU Project]. This page provides a place for Analytica users to share tricks ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

  1. Install the R Software for Windows (if you haven't already)
  2. Figure out how to perform the analysis of interest in R. Note down the list of commands you would issue in R.
  3. From your Analytica model, use WriteTextFile to write out the R commands that will need to be executed to a file.
  4. Use RunConsoleProcess to launch R.exe and run the analysis
  5. Use ReadTextFile to read the results
  6. 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


You are not allowed to post comments.