Re: [R] Warning message when returning multiple items

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Tue 31 Jan 2006 - 06:02:59 EST


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.

Andy

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@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
>
>



R-help@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 Received on Tue Jan 31 06:37:04 2006

This archive was generated by hypermail 2.1.8 : Tue 31 Jan 2006 - 08:25:28 EST