From therneau at mayo.edu  Tue Aug 13 14:54:35 2013
From: therneau at mayo.edu (Terry Therneau)
Date: Tue, 13 Aug 2013 07:54:35 -0500
Subject: [Rd] Multiple return values / bug in rpart?
In-Reply-To: <mailman.15.1376388008.32611.r-devel@r-project.org>
References: <mailman.15.1376388008.32611.r-devel@r-project.org>
Message-ID: <520A2C8B.4080901@mayo.edu>

I don't remember what rpartpl once did myself; as you point out it is a routine that is no 
longer used and should be removed.  I've cc'd Brian since he maintains the rpart code.

Long ago return() with multiple arguments was a legal shorthand for returning a list.  
This feature was depricated in Splus, I think even before R rose to prominence.  I vaguely 
remember a time when it's usage generated a warning.

The fact that I've never noticed this unused routine is somewhat embarrassing.  Perhaps I 
need a "not documented, never called" addition to R CMD check to help me along.

Terry Therneau

> In the recommended package rpart (version 4.1-1), the file rpartpl.R
> contains the following line:
>
> return(x = x[!erase], y = y[!erase])
>
> AFAIK, returning multiple values like this is not valid R. Is that
> correct? I can't seem to make it work in my own code.
>
> It doesn't appear that rpartpl.R is used anywhere, so this may have
> never caused an issue. But it's tripping up my R compiler.
>
> Thanks,
> Justin Talbot



[Rd] Multiple return values / bug in rpart?
Terry Therneau