Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Any good books or websites that teach linear programming / linear optimization with R? Thanks.

Edit (Jan 6, 2013): The following R code is an example by using the "lpSolve" package.

# Maximize 
#   x1 + 9 x2 +   x3 
# Subject to: 
#   x1 + 2 x2 + 3 x3 <= 9
# 3 x1 + 2 x2 + 2 x3 <= 15
f.obj <- c(1, 9, 3)
f.con <- matrix(c(1, 2, 3, 3, 2, 2), nrow = 2, byrow = TRUE)
f.dir <- c("<=", "<=")
f.rhs <- c(9, 15)

lp("max", f.obj, f.con, f.dir, f.rhs)
lp("max", f.obj, f.con, f.dir, f.rhs)$solution
share|improve this question
add comment

closed as off topic by Arkamis, Thomas, rschwieb, Asaf Karagila, Jason DeVito Oct 22 '12 at 19:01

Questions on Mathematics Stack Exchange are expected to relate to math within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 2 down vote accepted

Check out Using lpsolve from R

share|improve this answer
2  
In case the link goes stale, it would be nice to include a bit more information with your answer. –  robjohn Oct 22 '12 at 16:43
1  
Thanks @robjohn. I added an example in the original post. –  dwstu Jan 6 '13 at 4:30
    
@DanWu: my comment was intended for Vivian Wang regarding the link in the answer. The example code does not significantly enhance your reference request. Now that the question is closed here, you might as well simply ask it on Stack Overflow yourself (without the code, it should be pretty easy to copy). –  robjohn Jan 6 '13 at 5:39
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.