I am new to LP modelling in R. I am using lpSolveAPI. When I try a small example with two decision variables and print the model, then it prints the complete model.
library(lpSolveAPI)
lprec <- make.lp(nrow=0,ncol=2,verbose="full")
set.objfn(lprec,c(6,5))
lp.control(lprec,sense="max")
add.constraint(lprec,c(1,1),"<=",5)
add.constraint(lprec,c(3,2),"<=",12)
set.bounds(lprec,lower=c(0,0),columns = c(1,2))
RowNames <- c("A","B")
ColNames <- c("R1","R2")
dimnames(lprec) <- list(RowNames, ColNames)
print(lprec)
# Model name:
# R1 R2
#Maximize 6 5
#A 1 1 <= 5
#B 3 2 <= 12
#Kind Std Std
#Type Real Real
#Upper Inf Inf
#Lower 0 0
But when I try the model with 25 decision variables and after adding some constraints, if I try to print the model, then it just says:
Model name:
a linear program with 25 decision variables and 5 constraints
Please suggest how to display bigger models.