I wrote a code that uses 75(!!!) nested ifelse statements.
I know its probably the most inefficient code I could write, but when I tried to run it I received the following error:
>Error: unexpected ')' in:
" ifelse(basic$SEMType=="ppc" &
(grepl("Wellpoint Prospecting",basic$CategoryName)), "Wellpoint Prospecting","other"
)))))))))))))))))))))))))))))))))))))"
I checked and doubled checked the number of ")". Its correct and the ifelse closes.
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.
Has anyone ever encountered such limitations?
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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…