I’m new to R, but an experienced programmer. I need to traverse a large number of conditional processing elements. I can’t figure out how to exit an inner element and ‘fall through’ to the end of the outer element(s).
As an example:
I need to handle the situation where data fails the ifelse (Level2a), is processed at ifelse (level2b), then skips the remaining levels to the endwhile. The reason is that my (large) dataset will require >100 conditionals to be evaluated if I have to goo through each one. This is so simple to do in so many other languages, but I can’t figure out how to do it in R.
Is the switch() function what you need?
OK, I found the answer. The Break and Next functions are exactly what I was looking for and hadn’t found. Those, with Switch, will do the job nicely. Thanks.
You must be logged in to reply to this topic.