Skip to content
Prev 391012 / 398506 Next

R and tcltk Package

Dear Sirs,

I began not long ago to learn R. Now I want to understand the
tcltk binding. I have very elementary questions that are not
clear from help(TclInterface).

Let us say, I do
<Tcl> 2

How do I access the variable k from R?
And how do I access R variables from tcl?

I read that tclVar() creates a new Tcl variable. Well, the following
example shows that this is not 100% true:
[1] "::RTcl1"
<Tcl> 5
<Tcl> 5
<Tcl>
[1] "::RTcl2"

Since ::RTcl2 existed, b<-tclVar() should have created something
different and new, perhaps ::RTcl3.

Can I at least be sure that all variables generated by tclVar()
and tclArray() are of the form ::RTcl2N ?

And what are these callbacks, are they functions callable from Tcl?
The following does not work:
[1] 7
[1] " { R_call 0x80e29e2e0 }"
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
   [tcl] invalid command name " R_call 0x80e29e2e0 ".

Is there a more detailed guide than help(TclInterface)?

Thanks for any hint
Rodrigo