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:
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
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.
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
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 ,
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
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
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:
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
-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
10 matches
Mail list logo