[R] stop further sourcing of an R file
p.dalgaard at biostat.ku.dk
Fri Nov 14 13:36:36 CET 2003
(Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> writes:
> q() will terminate the entire R session.
> I suspect what Ramakrishna wants is to set a break-point
> in a source file, so as to just read in part of it, and
> then continue in the R session with other things.
> Though not what it's intended for, 'break' will do the job.
> E.g. if test.R contains
> then after
> R will plot the sine curve, but not the cosine curve, exiting
> at 'break' with the message
> No loop to break from, jumping to top level
> and the R session will still be intact, including any variables
> created in the script.
Similarly, stop() could be used, as, I suspect, anything else that
generates a (non-fatal) runtime error:
Error in eval.with.vis(expr, envir, enclos) :
> system("cat t.R")
x <- 1;
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help