Dinamica EGO and R Coupling

What will you learn?

Dinamica EGO can run R scripts as part of a model, and exchange data with an R session running alongside the model. Follow these steps:

  1. Set up R. On Windows, install the Dinamica EGO Enhancement Plugin, or use a local R installation; on Linux, install R and configure Dinamica EGO to use it. See Setup on Calculate R Expression.
  2. Run an R script in a model. Calculate R Expression receives data through hooks (t1, v1, s1, …) and returns its results in a Struct, read with the Extract Struct functors. Its page has worked examples, and the Guidebook dataset has example models in guidebook dinamica\extras\examples\various applications\calculate r expression.
  3. Select the R interpreter. Choose between the plugin’s interpreter and a local R installation in *Tools → Options Integration*.
  4. Exchange data with a running R session. For models where R and Dinamica EGO run side by side, see Coupling with R, which also describes the legacy ways of calling one tool from the other.

Congratulations, you have successfully completed this lesson!

☞Next: Python Coupling


This documentation was generated with the help of large language models (LLMs) and may contain errors. Please verify critical information.