Skip to content
Prev 46356 / 63424 Next

Multiple return values / bug in rpart?

On 13/08/2013 13:54, Terry Therneau wrote:
Yes, usage generated a warning then an error, but not parsing.

 > foo <- function() return(a=1, b=2)
 > foo()
Error in return(a = 1, b = 2) : multi-argument returns are not permitted
But you cannot know 'never called'.  This is callable by 
rpart:::rpartpl() : it is also possible that functions in your namespace 
are called via eval()ing expressions at R or C level.  (There are 
examples around for which that is the only usage.)