'next' for the parent for loop within a function -- possible?

for (...) {
  df = custom_function(...)
}

Let's say there was some condition within the custom_function. If that condition is met, how can I make the go on the next iteration of this for loop? It seems that I cannot just run next inside the function.

I saw this answer: breaking out of for loop when running a function inside a for loop in R - Stack Overflow

However, the constraint is that the function should not return NULL, NA, or something similar.

Can you provide minimal reproducible codes?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.