[BioC] How to conditionally exit from a function?
SHEN, WEICHENG .
WEICHENG.SHEN at saic.com
Wed May 21 18:48:01 MEST 2003
Hi all:
I need to conditionally exit from a function, but don't know how. My example
below indicates that when x>0, I wish to immediately exit from the function
foo. I also with to return a flag value so that I could find out what
happend in executing this function. What command I can use to make it
happen? Your help and suggestions will be greatly appreciated. Thanks!
============================================================================
===================================
foo<-function (x)
{
if (x>0) {
do something ....
} else {
# need to exit from this function at this point, and also
return a flag value
}
do something ...
}
Weicheng Shen, Ph.D.
Senior Image Analyst
Science Applications International Corporation
1710 SAIC Drive
Mail Stop 2-6-9
McLean, VA 22102
(703) 676-4189
More information about the Bioconductor
mailing list