title: A basic example of the simplex function in R with errors
body: <p>Good morning,
  I have a question to an optimization problem I can't solve in R but in Excel:</p>
  
  <p>I would like to optimize the following situation (Transportation of material and people):<br>
  Airline x1 can transport 50t of material and 500 people<br>
  Airline x2 can transport 150t of material and 250 people<br></p>
  
  <p>50x1 + 150x2 >= 900        -> Transportation of material min. 900<br>
  500x1 + 250x2 >= 2500      -> Transportation of people min. 2500<br></p>
  
  <p>x1 is an airline with flight costs of 2500 per flight
  x2 is an airline with flight costs of 3500 per flight
  The costs should be minimized!</p>
  
  <p>x1>=0<br>
  x2>=0<br></p>
  
  <p>Here is my solution in R (function simplex from the package "boot"):</p>
  
  <pre><code>library("boot")    
  a &lt;- c(2500, 3500)
  A2 &lt;- matrix(c(50, 150, 500, 250), ncol=2, nrow=2, byrow=TRUE)
  b2 &lt;- c(900, 2500)
  simplex(a, A2 = A2, b2 = b2, maxi=FALSE)
  </code></pre>
  
  <p>I get the following error:<br>
  Fehler in pivot(tableau, prow, pcol) : 
    NAs nicht zugelassen in Teilbereichszuweisungen</p>
  
  <p>Excels Solver gives me the exact solution:
  x1 = 2.4 and x2 = 5.2</p>
  
  <p>Where is my error in R? I have to use the arguments A2 and b2 because of >= ...
  Thank's for any help!</p>
  
  <p>Just a short extension:
  I solved the given problem using the function "solveLP" from the package "linprog" using the following syntax:</p>
  
  <pre><code>solveLP(cvec = a, bvec = b, Amat = A, 
      maximum=FALSE, const.dir=c("&gt;=","&gt;="))
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>A &lt;- matrix(c(-50,-150,-500,-250),nrow=2,ncol=2,byrow=TRUE)
  a &lt;- c(2500, 3500)
  b &lt;- c(-900, -2500)
  solveLP(a,b,A,maximum=FALSE)
  </code></pre>
  
  <p>Still wondering why the function simplex gives me this errors?</p>