[R] Warning message when returning multiple items

Liaw, Andy andy_liaw at merck.com
Mon Jan 30 20:02:59 CET 2006

For the last few versions of R (don't remember when the change happened
now), you need to explicitly wrap the objects in a list, instead of simply
having them in return().  I.e., instead of return(a=thing1, b=thing2), you
simply use list(a=thing1, b=thing2) as the last line of the function.


From: Krish Krishnan
>  In my function I am trying to return multiple computed items 
> (separated by commas).  The function does what I need, but I 
> get a warning message that multi-argument returns are 
> deprecated.  Is this a warning I should heed, or is there a 
> more elegant and warning free way of achieving the same end?  Thanks
> ---------------------------------
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

More information about the R-help mailing list