On 3/17/2015 10:01 AM, David Winsemius wrote:
On Mar 16, 2015, at 5:05 PM, Saptarshi Guha wrote:

Example was complicated, but here is a simpler form

continueIfTrue <- function(mm=return()){
    eval(mm)
}
What are you trying to accomplish by passing `return()` to a formal parameter?


Might returning a logical serve your purpose? Then you could say "if(!continueIfTrue(...))return(...)". Will this do what you want?


      Spencer

telemStats <- function(){
    y <- substitute(return())
That last bit of code doesn't make a lot of sense either. The `substitute` function is 
specifically designed to NOT evaluate the first argument but rather to return an 
unevaluated call. If you wanted to actually "return" from that function you 
would assuredly not use `return` within the substitute argument.

You need to explain what you want to accomplish  rather than posting failed 
code.


______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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