File Edit Packages Windows Help
1 iy |
w |
n |
# |
R Console
> lp.transport (koszty, "min", row.signs, row.rhs, col.signs, col.rhs)$solution Error in lp.transport(koszty, "min", row.signs, row.rhs, col.signs, col.rhs) : Error: We have 3 signs, but 5 columns library(lpSolve) library(RODBC) setwd("c:/polu/")
dane <- odbcConnectExcelCstart.xls") koszty <- sqlQuery(dane, "select * from [Arkuszl$]")
Warning messages:
1: closing unused ROD3C handle 2
closing unused R0D3C handle koszty=as.matrix(koszty) row.signs <- rep ("<=", 4) row.rhs <- c(120,120,40,280) col.signs <- rep (">="/ 3) col.rhs <- c(100,100,100) lp.transport (koszty, "min",
Success: the objective function is 1580000 > lp.transport (koszty, "min", row.signs, row.rhs,
1
row.signs, row.rhs, col.signs, col.rhs]
col.signs, col.rhs)$solution
P
0
[,1] |
[,2] |
[,3] | |
u,] |
100 |
0 |
0 |
[2,] |
0 |
60 |
60 |
[3,] |
0 |
0 |
40 |
[«,] |
0 |
40 |
0 |
> 1 | |||
4 |