[S] saving partial results from unfinished for loop

Franz-Josef Mueter (mueter@ims.uaf.edu)
Mon, 3 Aug 1998 07:01:42 -0800 (AKDT)

Dear S+ers

I have come across this several times now and thought I'd ask.
For saving results from bootstraping or some randomization test I often
write functions that
1. create an empty matrix for storing results
2. loop through i cases and perform a series of computations for each case
3. store result (either a single value or a vector) from the ith
computation in the ith row or column of the results matrix

Now sometimes I get impatient and would like to quit before the function
is finished. Is there any way to stop execution of the function, yet
somehow save the matrix of partial results (having neglected to built
appropriate features into the function itself!)

Thanks for any hints,



Since all models are wrong, the scientist must be alert
to what is importantly wrong. It is inappropriate to be
concerned about mice when there are tigers abroad.
- Box, 1976

Franz-Josef Mueter | Voice: (907) 474-7839
Institute of Marine Sciences | (907) 479-8815
School of Fisheries and Ocean Sciences | Fax: (907) 474-1943
University of Alaska | e-mail:
Fairbanks, Alaska, 99709-1080 | mueter@ims.alaska.edu
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news