[R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. -- View this message in context:

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 9:52 AM, madr wrote: I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. ?stop -- David Winsemius, MD West Hartford, CT

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
I try to use stop(), but i get: Error in eval.with.vis(expr, envir, enclos) : -- View this message in context: http://r.789695.n4.nabble.com/beginner-simple-keyword-to-exit-script-tp3052417p3052430.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread David Winsemius
stop() throws an error but the side effect is to pop out of whatever environment you may be in and return to the top-level. I thought that was what you wanted. If not, then please produce a better problem description with code as requested in the posting guide. On Nov 21, 2010, at 10:12

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 10:43 AM, madr wrote: Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, If you are in a function, then return() like after user input, exiting then is not always identical with error ,

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, like after user input, exiting then is not always identical with error , there are cases when it is intended behavior. I thought R makes that distinction. -- View

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread Gabor Grothendieck
On Sun, Nov 21, 2010 at 9:52 AM, madr madra...@interia.pl wrote: I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. 1. use my.source() below instead of

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread Henrik Bengtsson
Better is probably to return() from a function, i.e. define a function in your script and call that at the end of your function, e.g. - - - - main - function() { # bla # bla if (something) { return(); } # otherwise # bla } main(); - - - - Otherwise, here is a hack:

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread Petr Savicky
On Sun, Nov 21, 2010 at 10:56:14AM -0500, David Winsemius wrote: On Nov 21, 2010, at 10:43 AM, madr wrote: Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, If you are in a function, then return() like

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Henrik Bengtsson Sent: Sunday, November 21, 2010 8:17 AM To: David Winsemius Cc: r-help; madr Subject: Re: [R] [beginner] simple keyword to exit script ? Better is probably