title: replacement has length zero: auglag function from alabama package in R
body: <p>(edited)
  I've tried to repeat an example found in the Internet (the code is below). Unfortunately, I had an error: <strong>"Error in h[1] &lt;- x[1] - 900 : replacement has length zero"</strong>
  The task is to minimize a function given equality and inequality constraints:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code># To minimize:  -(0.653*x[1] + 0.234*x[1]*x[1]+ 0.437*x[2]
  # + 0.769*x[3] + 0.453*x[4] + 0.744*x[5] + 0.476*x[5]*x[5])
  
  # Equality constraint: x[1] + x[2] + x[3] + x[4] + x[5] = 2600
  
  # Inequality constraints:
  # x[1] &gt; 900      # x[4] &gt; 175
  # x[1] &lt; 1100     # x[4] &lt; 225
  # x[2] &gt; 400      # x[5] &gt; 295
  # x[2] &lt; 600      # x[5] &lt; 305
  # x[3] &gt; 250
  # x[3] &lt; 350</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>fn &lt;- function(x) {
    -(0.653 * x[1]+ 0.234 * x[1] * x[1]+ 0.437 * x[2] + 0.769 * x[3] +
        0.453 * x[4] + 0.744 * x[5] + 0.476 * x[5] * x[5])
  }
  
  heq &lt;- function(x) {
    h &lt;- rep(NA, 1)
    h[1] &lt;- x[1] + x[2] + x[3] + x[4] +x[5] - 2600
    h
    }
  
  hin &lt;- function(x) {
    h &lt;- rep(NA, 1)
    h[1] &lt;- x[1] - 900
    h[2] &lt;- 1100 - x[1]
    h[3] &lt;- x[2] - 400
    h[4] &lt;- 600 - x[2]
    h[5] &lt;- x[3] - 250
    h[6] &lt;- 350 - x[3]
    h[7] &lt;- x[4] - 175
    h[8] &lt;- 225 - x[4]
    h[9] &lt;- x[5] - 295
    h[10] &lt;- 305 - x[5]
    h
  }
  
  ans &lt;- auglag(par=NULL,fn=fn, gr=NULL,hin=hin, heq=heq)</code></pre>
  </div>
  </div>
  </p>