Running the example

To run one of the R examples provided with the Gurobi distribution, you can use the source command in R. For example, if you are running R from the Gurobi R examples directory, you can say:

> source('mip.R')

If the Gurobi package was successfully installed, you should see the following output:

[1] "Solution:"
[1] 3
[1] 1 0 1

The R example directory <installdir>/examples/R contains a number of examples. We encourage you to browse and modify them in order to become more familiar with the Gurobi R interface.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.