One small improvement, the cat can be eliminated:
f <- function() {
x <- readline("c to continue, anything else to quit: ")
if (x != "c") stop("User forced exit")
# rest of function
}
f()
On 6/25/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> Try this:
>
> f <- function() {
> cat("c to continue, anything else to quit: ")
> x <- readline()
> if (x != "c") stop("User forced exit")
> # rest of function
> }
>
> f()
>
> On 6/25/06, Matthew Bridgman <[EMAIL PROTECTED]> wrote:
> > I want to put warning messages into some of my functions to remind
> > myself to change the output file names each time I run them. Is there a
> > way to do this that will allow me to respond to the warning message
> > (i.e. "continue function" or "cancel")?
> >
> > Thanks,
> > Matt
> >
> > ______________________________________________
> > [email protected] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> >
>
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html