Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread John Chambers
And just in case anyone is curious about the history, return() with multiple arguments was legal in S2 but the syntax in the blue book had only return(expr), whether enforced or not in the code. John On 8/13/13 11:42 AM, luke-tier...@uiowa.edu wrote: Both codetools and the compiler should

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread luke-tierney
Both codetools and the compiler should be checking for use of multiple args in return -- I'll look into adding that. Best, luke On Tue, 13 Aug 2013, Duncan Murdoch wrote: On 13-08-13 8:59 AM, Prof Brian Ripley wrote: On 13/08/2013 13:54, Terry Therneau wrote: I don't remember what rpartpl o

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread Duncan Murdoch
On 13-08-13 8:59 AM, Prof Brian Ripley wrote: On 13/08/2013 13:54, Terry Therneau wrote: 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 multi

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread Prof Brian Ripley
On 13/08/2013 13:54, Terry Therneau wrote: 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 returni

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread Terry Therneau
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

[Rd] Source location of currently evaluated code?

2013-08-13 Thread Vitalie Spinu
Hi, Is there a way to retrieve the parsed location of currently executed function? In other words, how to define a function "foo" such that when sourced from a file "file_with_foo.R" containing foo() at line 1, it should print: foo called in file_with_foo.R at line 1 Thanks, Vitalie

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread Simon Urbanek
On Aug 13, 2013, at 5:27 AM, Barry Rowlingson wrote: > On Mon, Aug 12, 2013 at 6:06 PM, Justin Talbot wrote: >> 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

Re: [Rd] Multiple return values / bug in rpart?

2013-08-13 Thread Barry Rowlingson
On Mon, Aug 12, 2013 at 6:06 PM, Justin Talbot wrote: > 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 mak