Optimization Output


I’m trying to obtain a particular output of an lp model in R. This is what’s currently coming up as the output:

[1] 0.0 4.5 0.0

I know that adding “all.int=TRUE” will show the output as all integers:
[1] 1 4 0

But now I need all of the output to be at least 1. What command would I use so that all 3 outputs would be at least 1 or greater? In Excel’s Solver, you can specify your 3 output cells to be greater than or equal to 1, so what is the R version of this constraint?


Hi @bwalker85,
Welcome to the RStudio Community Forum.

I assume you are using the lpSolve package since you posted no code. If so, check out the function lpSolveAPI::set.bounds() that should address your question. See example here:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.