[ESS] How to tell if R is ready after ess-eval-*?

Vitalie Spinu spinuvit.list at gmail.com
Thu Jul 7 17:40:35 CEST 2011


Ulrich Keller <uhkeller at googlemail.com> writes:

> Thans for your reply, Rodney.
>
> And sorry, I didn't phrase the description quite right. I too get the
> new prompt only after 5 seconds, but this is a very subtle indicator of
> R's status. If I send more than one line with ess-eval-region, I'd have
> to count the new prompts and see if they match the number of lines I
> sent to determine if R is finished or not. Not very practical.
>
> The background is that I often run largish scripts that read complicated
> and often broken data. Usually, something goes wrong somewhere, so
> stepping through the script and fixing errors as they occur is really
> the only option. Because the data tend to be large, running a few lines
> can take a some minutes, and it would be nice if ESS could tell me when
> R is done.
>

Hi Ulrich,

I've just implemented the animated indicator of process status in
ess-tracebug (http://code.google.com/p/ess-tracebug/#Miscellaneous_enhancements)

Technically it is not always possible to tell if the process is busy. But in
most of the cases, it works smoothly.

Particularly if you send your input with 'ess-eval-visibly-p' being 't' it
will always work.

It will also always work with one line input.

With several commands input you better spread your commands for several
lines or enclose with {...}:

for(i in 1:5)
    Sys.sleep(.5)
for(j in 1:10) Sys.sleep(.4)

instead of

for(i in 1:5) Sys.sleep(.5)
for(j in 1:10) Sys.sleep(.4)

Personally I don't see how to improve on what is already there.

Enjoy,
Vitalie

> (I used to have a system monitor applet in my Gnome panel to monitor CPU
> usage instead, but with the non-configurable Gnome 3 panels, this is no
> longer an option.)
>
> On Wed, 2011-05-04 at 16:42 -0500, Rodney Sparapani wrote:
>> On 05/ 4/11 02:31 AM, Ulrich Keller wrote:
>> > Dear list members,
>> >
>> > maybe I am missing something obvious here, but how can I tell when R is
>> > ready after sending a longer-running command with e.g. ess-eval-line?
>> > For example, if I send this:
>> >
>> > Sys.sleep(5)
>> >
>> > with ess-eval-line, the minibuffer will immediately say "Finished
>> > evaluation" and the process buffer will show the usual prompt (">").
>> > However, R will not accept input for 5 seconds.
>> >
>> 
>> Hi Ulrich:
>> 
>> I do not see this behavior.  Rather, I do get the spurious
>> "Finished evaluation" message, but I do not see the new prompt until 5s
>> have expired.
>> 
>> Rodney
>> 
>> ______________________________________________
>> ESS-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list