An example of how you can use OPL from the R language has been delivered here: doopl-R-sample.
The doopl package enables you to run an OPL model by providing its inputs via Python structures (pandas dataframes, list/set of tuples) and getting the post-processing tables as dataframes.
The reticulate package provides a comprehensive set of tools for interoperability between Python and R.
It exposes all Python methods from doopl, and takes care of all the data transfers by providing conversion operators for some of the most commonly used Python objects, including:
* Built-in Python objects (lists, dictionaries, numbers, strings, tuples)
* Pandas objects (Index, Series, DataFrame),
that are the possible IOs of doopl.
This is an example given as-is to demonstrate how to mix OPL and R. It is not intended as a sample that is officially supported by the DO team. Note that the DO team does not provide support for the open-source reticulate package.