Re: [R] how to get or store the intermediate v?lues while running a function

From: <vincent_at_7d4.com>
Date: Tue 06 Dec 2005 - 21:09:36 EST

shanmuha boopathy a écrit :

> a<-function(a,b,c,d)
> {
> k=a+b
> l=c+d
> m=k+l
> }
>
> in this example the function will return only the value of "m"
> ...But I like to extract the values of "l" & "k" also.........
> which command to use for storing or for extracting those intermediate value.......

may I suggest, inside your function

res = c(k, l, m);
return(res);
# also ... read some intro docs !



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 Dec 06 21:46:26 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:29 EST