Step 1: download cplexAPI : Step 2: edit src/Makevars.win like the following, make sure cplex1280 is equal to your version you must change to the corresponding number you can find in C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/bin/x64_win64:
PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include"
PKG_LIBS=-L"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/bin/x64_win64" -lm -lcplex1280
Step 3: in a R console, on the right folder:
devtools::install("C:/whatever/cplexAPI_1.3.3/cplexAPI", upgrade_dependencies = FALSE)