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>', repos=NULL)The R package file can be found in the
<installdir>/R
directory of your Gurobi installation.
For a default installation of Gurobi 10.0.3, the command would be:
install.packages('c:/gurobi1003/win64/R/gurobi_10.0-3.zip', repos=NULL)
You will need to adjust the path to match your installation directory and version.
You will need to be careful that the R binary and the Gurobi package you install both use the same instruction set. To use the Gurobi R package, you will need to use the 64-bit version of R. 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, you may need to set the rsession-ld-library-path
entry in the server config file. Refer to the File Overview for information on where to
find the appropriate file in the Gurobi distribution.
Please consult the RStudio documentation for more information.