Skip to content

About Tcl/Tk after command in R

3 messages · davide.massidda at unipd.it, Duncan Murdoch, Peter Dalgaard

#
Dear R-helpers,
I have a problem with the tcl "after" instruction. When I send:
Loading Tcl/Tk interface ... done
try tcl after
<Tcl>

the tcl command works fine. Similarly, the tcl command:
<Tcl>

works fine. But, if I send the command:
<Tcl> after#0

appears a popup window which reports:

Error: invalid command name ?100?

Why?



Davide Massidda

Universit? di Padova
Dipartimento di Psicologia Generale
Via Venezia, 8 - 35131 Padova - Italy

QPLab http://qplab.psy.unipd.it/
tel. +39 049 8276905
#
On 1/15/2009 10:18 AM, davide.massidda at unipd.it wrote:
The value of cat("something") is NULL, the value of plot(something) is 
NULL, but the value of 10^2 is 100.  You're trying to execute no Tcl 
command in the first two cases, but you're trying to execute the command 
"100" in the last, and that's not a legal Tcl command.

Duncan Murdoch
#
Duncan Murdoch wrote:
Yes. Notice also that the argument is intended to be something to do
*after* the period of time has elapsed, and as written, it happens
immediately. You can use an R expression there, but it needs to be an
unevaluated call, usually created by
quote() or expression().
1:10){print(i);Sys.sleep(1)}
<Tcl> after#4
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
try tcl after
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10