Installing the R Package

To begin, you'll need to install the Gurobi package in R. The R command for doing this is:

install.packages('<R-package-file>')
The Gurobi R package file can be found in the <installdir>/R directory of your Gurobi installation (e.g., /opt/gurobi560/linux64/R for the 64-bit Linux version of Gurobi 5.6). You should browse the <installdir>/R directory to find the exact name of the file for your platform (the 64-bit Linux package is in file gurobi_5.6-0_R_x86_64-pc-linux-gnu.tar.gz, while the Windows package is in file gurobi_5.6-0.zip).

You will need to be careful that the R binary and the Gurobi package you install both use the same instruction set. For example, if you are using the 64-bit version of R, you'll need to install the 64-bit version of Gurobi, and the 64-bit Gurobi R package. This is particularly important on Windows systems, where the error messages that result from instruction set mismatches can be quite cryptic.

If you are using R from RStudio Server, and you get an error indicating that R is unable to load the Gurobi DLL or shared object, you may need to set the rsession-ld-library-path entry in the server config file. Please consult the RStudio documentation for more information.

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.

Search