shanmuha boopathy
2005-Dec-06 09:50 UTC
[R] how to get or store the intermediate v?lues while running a function
Dear all,
While running a function I伌m getting only the final output of the function.
Bit if I like to store or recover some values that are intermediate in the
function calculations which command I have to use for storing those values.....
hope u understand.....
for eg........
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.......
thank you all.
with regards,
boopathy.
Thirumalai Shanmuha Boopathy,
Zimmer no : 1109,
R侟tscher strasse 165,
52072 Aachen .
Germany.
Home zone : 0049 - 241 - 9813409
Mobile zone : 0049 - 176 - 23567867
---------------------------------
[[alternative HTML version deleted]]
vincent@7d4.com
2005-Dec-06 10:09 UTC
[R] how to get or store the intermediate v?lues while running a function
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 !
Possibly Parallel Threads
- how to plot the circles in matrix form
- how to extract row& col names from a matrix
- R graphics help
- how to extract the column name or value from the numerical value of the matrix
- how to extract the column name or value from the numerical value of the matrix