A321
A321

Reputation: 17

Run CPLEX mod within in R script

I the following setup. I implemented a model in Rstudio. This model creates data for CPLEX optimization studio. At the moment R creates an excel sheet. This excel sheet in then read by CPLEX into a .dat file. This .dat file in then used in the .mod file in CPLEX. The problem is that at the moment the manual effort is too high, because I have to first run the R file, then switch to the CPLEX file and run this again.

Is there any option to integrate the CPLEX mod into the R model so that with running the R model both the R model and the CPLEX model work?

Kind Regards!

Upvotes: 0

Views: 279

Answers (1)

Alex Fleischer
Alex Fleischer

Reputation: 10062

In how to with OPL How to call CPLEX from R ?

In R you can call OPL through a system call:

system("oplrun diet.mod diet.dat") 

But you can also use RCplex or cplexAPI

Upvotes: 0

Related Questions