[R] one function with 2 returnh points
landronimirc at gmail.com
Sat Oct 30 11:31:35 CEST 2010
On Sat, Oct 30, 2010 at 11:09 AM, Alaios <alaios at yahoo.com> wrote:
> Hello everyone.
> I have written quite a big function that at the end correctly returns the values
> I want. I found a rare exception that I want to cover also. The easier for me
> would be to write something like that
> if (rare exception happened)
> return that value
> # The comes the code for normal execution
> # ...
> # ...
> return value # Normal values to return
Are you looking for something similar?
res <- sum(1:10)
 "Error: wrong!"
> Would that be feasible with R or two returns statements are not accepted?
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Do you know how to read?
Do you know how to write?
More information about the R-help