title: Is there a limit for the possible number of nested ifelse statements
body: <p>I wrote a code that uses 75(!!!) nested ifelse statements.</p>
  
  <p>I know its probably the most inefficient code I could write, but when I tried to run it I received the following error:</p>
  
  <pre><code>&gt;Error: unexpected ')' in:
  "                                 ifelse(basic$SEMType=="ppc" &amp;
   (grepl("Wellpoint Prospecting",basic$CategoryName)), "Wellpoint Prospecting","other"
                                       )))))))))))))))))))))))))))))))))))))"
  </code></pre>
  
  <p>I checked and doubled checked the number of ")". Its correct and the ifelse closes.</p>
  
  <p>I also tried to run the nested ifelse by chunks, 15 at a time (and sometimes bigger chunks) and it works, so I figured the chance for syntax error is low.</p>
  
  <p>Has anyone ever encountered such limitations?</p>
  
  <p>I now run the code piece wise the inner ifelse first and record the result and move up the channel. This seems to work so far.</p>