From hb at stat.berkeley.edu  Tue Jun 29 18:04:20 2010
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Tue, 29 Jun 2010 18:04:20 +0200
Subject: [Rd] Catching Ctrl-C/Esc at R-level
In-Reply-To: <AANLkTimZ5Rz-7MQB93oyGYTNclgbryeVtejkMEpF3PhX@mail.gmail.com>
References: <AANLkTimZ5Rz-7MQB93oyGYTNclgbryeVtejkMEpF3PhX@mail.gmail.com>
Message-ID: <AANLkTikIrth6F6XG5V-X6SPb4eeq3nj5FqAB39fvMac-@mail.gmail.com>

Yes, you catch user interrupts (Ctrl-C) with tryCatch(...,
interrupt=function(cond) { ...}), cf.

http://www1.maths.lth.se/help/R/ExceptionHandlingInR/

/Henrik

On Tue, Jun 29, 2010 at 5:46 PM, Hadley Wickham <hadley at rice.edu> wrote:
> Hi all,
>
> Is it possible to catch when the user presses Ctrl+C/Esc and deal with
> it at the R level?
>
> Hadley
>
> --
> Assistant Professor / Dobelman Family Junior Chair
> Department of Statistics / Rice University
> http://had.co.nz/
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Catching Ctrl-C/Esc at R-level
Henrik Bengtsson