This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import lpSolve package | |
library(lpSolve) | |
# Set coefficients of the objective function | |
f.obj <- c(5, 7) | |
# Set matrix corresponding to coefficients of constraints by rows | |
# Do not consider the non-negative constraint; it is automatically assumed | |
f.con <- matrix(c(1, 0, | |
2, 3, |