[R] interrupting R

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jan 3 08:02:12 CET 2009


On Fri, 2 Jan 2009, Markus Loecher wrote:

> Thank you for the quick reply.
> It seems that Ctrl-C interrupts "pure" R functions (i.e. R scripts that do
> not call external compiled libraries) but when I run functions that in turn
> call external C code (such as gam() in the package mgcv), the Ctrl-C does
> not appear to propagate that deeply, if I may use such loose language.

You are leaping to conclusions.  Compiled code can arrange to be 
interruptible or not, and that in R itself has made suitable arrangements. 
Another issue to take up with the author of mgcv ....

> The Stop icon in the R.app on MAC OS is similarly unresponsive when e.g.
> gam() is performing some extensive computations.
> (I am just using gam() as an example, nothing special about it, I think)
> 
> You are right, I should ask the author about the source code, I just did not
> want to add more requests to his InBox.
> 
> Thanks again,
> 
> Markus
> 
> On Fri, Jan 2, 2009 at 8:56 AM, Prof Brian Ripley <ripley at stats.ox.ac.uk>
> wrote:
>       On Fri, 2 Jan 2009, Markus Loecher wrote:
>
>             Dear fellow R users,
>             is there a generic way to gracefully interrupt an R
>             function without
>             terminating the entire session ? I am mainly
>             interested in this answer for
>             Linux and MacOS.
>             I found neither Esc nor Ctrl-C to work; it seems
>             that R does not check for
>             signals periodically?
> 
> 
> Well, Ctrl-C works for me.  Rather than check for signals, R installs
> a signal handler and gets the OS to do the work.
> 
> On Mac OS it is unclear if you mean R or R.app.  R.app has a Stop sign
> icon, amongst other ways.
>
>       Also, an entirely unrelated question: I have been looking
>       unsuccessfully for
>       the R sources for the examples given in Simon Wood's book
>       on Generalized
>       Additive Models. I had hoped they would be part of the
>       mgcv package but they
>       are not.
>       Has anyone had any luck with this ?
> 
> 
> Why not ask him directly?
>
>       Thanks,
>       Markus
>
>              [[alternative HTML version deleted]]
>
>       ______________________________________________
>       R-help at r-project.org mailing list
>       https://stat.ethz.ch/mailman/listinfo/r-help
>       PLEASE do read the posting guide
>       http://www.R-project.org/posting-guide.html
>       and provide commented, minimal, self-contained,
>       reproducible code.
> 
> 
> --
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
> 
> 
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


More information about the R-help mailing list