title: lpSolve in R Crashing Linear Programming Problem
body: <p>I have prepared the following reproducible example showing that lpSolve in R crashes with example 2 and I'm needing some help to identify why so it doesn't crash R.</p>
  <p>The data and constraints were a bit large so I placed those on github and they can be read in for the example. The only difference between the one that works and the one that crashes R is the objective function values. Same constraints used in both but the values in the vector f.obj1 and f.obj2 differ.</p>
  <p>Now I believe example 2 is infeasible. However, in smaller examples lpSolve returns to the user a solution is infeasible. In this case, it's simply crashing but I'm not certain why. Perhaps there is a setting in lpSolve that might stop this from crashing R?</p>
  <p>Thank you in advance for any help on this problem.</p>
  <pre><code>library(lpSolve)
  f.con &lt;- as.matrix(read.csv('https://raw.githubusercontent.com/hdoran/Blog/master/SOData/f.con.csv'))
  dat &lt;- read.csv('https://raw.githubusercontent.com/hdoran/Blog/master/SOData/dat.csv')
  constraintMat &lt;- structure(list(constraint = c(&quot;total&quot;, &quot;strand1&quot;, &quot;strand2&quot;, 
  &quot;strand3&quot;, &quot;strand4&quot;, &quot;tminus1min&quot;, &quot;tminus1max&quot;, &quot;at0min&quot;, &quot;at0max&quot;, 
  &quot;tplus1min&quot;, &quot;tplus1max&quot;), value = c(100L, 25L, 25L, 25L, 25L, 
  5L, 8L, 22L, 26L, 40L, 45L), direction = c(&quot;=&quot;, &quot;=&quot;, &quot;=&quot;, &quot;=&quot;, 
  &quot;=&quot;, &quot;&gt;=&quot;, &quot;&lt;=&quot;, &quot;&gt;=&quot;, &quot;&lt;=&quot;, &quot;&gt;=&quot;, &quot;&lt;=&quot;)), class = &quot;data.frame&quot;, row.names = c(NA, 
  -11L))
  
  K &lt;- 2000
  f.dir &lt;- c(constraintMat$direction, rep(&quot;&lt;=&quot;,K))
  f.rhs &lt;- c(constraintMat$value,rep(1,K)) 
  result &lt;- lp(&quot;max&quot;, dat$f.obj1, f.con, f.dir, f.rhs, all.bin=TRUE) # Works
  result &lt;- lp(&quot;max&quot;, dat$f.obj2, f.con, f.dir, f.rhs, all.bin=TRUE) # Crashes R 4.2.0
  </code></pre>