Bill Cunliffe wrote:
For example, based on a certain condition, I may want to exit my code early:

            # Are there the same number of assets in "prices" and
"positions"?

            if (nAssetPositions != nAssetPrices) {

                        cat("Different number of assets! \n\n")

                        <exit function>


I've wondered about that myself

Have you tried  return() ? It would return NULL I think, as long as that
doesn't cause a problem it should exit the method.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to