[Rd] RFC: Different handling of commands from clipboard in Windows Re: [R] how to pause between plots running scripts?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Mon 29 Nov 2004 - 02:25:24 EST

(Moved from r-help to r-devel)

Terry Mu pointed out that in Windows par(ask=T) works when a script is sourced, but not when it is run from the script editor. I think the reason for this is that the script editor copies the selection to the clipboard and then pastes it to the console. When the console stops to ask the user to hit Enter to continue, the next pasted line satisfies the request, and things continue on.

This is also a problem with other cut and paste mechanisms: if you cut from an external editor and paste to the console, often you'd want par(ask=T) to work, and you'd want a syntax error to abort the paste, etc.

Finally, I find that sometimes (e.g. when updating a function definition) I'd like to be able to do a "silent paste", where the code is processed and executed, but it doesn't show in the console or the history list.

We already have code to source() from the clipboard, and it could address the problems above, but:

Another approach would be to make the input routines smarter: e.g. clear the input buffer when there's a syntax error, suspend it when asking for confirmation before the next graph: but this looks potentially really messy to me.

Another that deals only with the original graphics problem is to have par(ask=T) wait for input to the graphics window, rather than to the console. This has the advantage that the graphics window probably has the focus, so a simple Enter there could satisfy it.

Or some other approach, or some combination of approaches.

Comments?

Duncan Murdoch

On Sat, 27 Nov 2004 22:38:34 -0500, Duncan Murdoch <murdoch@stats.uwo.ca> wrote:

>
>>> > I used pause() from library(DAAG) to pasue between plots. This works
>>> > when I source a script, but seems don't work when I run (ctrl + R) the
>>> > script in R.
>
>This sounds like a bug to me, but I'm not sure it's going to be an
>easy one to fix.
>
>Duncan Murdoch
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon Nov 29 02:33:18 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:01:48 EST