R-beta: return()

Peter Dalgaard BSA p.dalgaard at kubism.ku.dk
Thu Sep 25 19:35:35 CEST 1997


Bill Simpson <wsimpson at uwinnipeg.ca> writes:

> thingy<-function(k)
> {
> x<-5+k
> y<-5-k
> return(list(x=x,y=y))
> }
> 
> thingy2<-function()
> {
> thingy(10)
> cat("x,y:",x,y,"\n")
> }

Try
thingy2<-function()
{
l<-thingy(10)
cat("x,y:",l$x,l$y,"\n")
}


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the R-help mailing list