[R] Multi arguments - return

John Kane jrkrideau at yahoo.ca
Tue Mar 11 18:57:00 CET 2008


I think you need to provide an example.  We have no
way of knowing what you are putting in the list.  
--- Gustave Lefou <gustave5000 at gmail.com> wrote:

> Hello,
> 
> I wanted a function to have two vectors x,y as its
> output. I wrote
> return(x,y) inside its definition. It worked but I
> got a warning : it is
> obsolete to do like that.
> 
> So I tried to put x,y in a list(x,y) and to
> return(list(x,y)). It worked. I
> called the return of the function result. But
> result[1] is no longer a
> vector and I need a vector. I tried
> as.numeric(result[1]) but it does not
> work.
> 
> How can I do ?
> 
> Thank you very much.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>



More information about the R-help mailing list