title: Customize existing function in R
body: <p>I want to change a condition within the function <code>psych::polychoric</code> in R.
  Specifically, I want to increase the limit of different realizations of a a variable from 8 to 10 on line 77 of the code.
  I can manually increase the limit by calling</p>
  
  <pre><code>trace(polychoric, edit=TRUE)
  </code></pre>
  
  <p>Since the script is meant for reproduction purposes for a paper of mine, I want to make handling as smooth as possible by avoiding manual editing.
  Is there a way to edit the function by a piece code,
  e.g. by replacing <code>if (nvalues &gt; 8)</code> by <code>if (nvalues &gt; 10)</code> in the code by another function?</p>
  
  <p>Any suggestions would be much appreciated.</p>