[R] pure TCL run a command within the R via the tcltk package?

Cleber N.Borges klebyn at yahoo.com.br
Mon Oct 10 02:59:34 CEST 2016


Dear,
is there any way of a button on pure TCL run a command within the R via 
the tcltk package?
thank you in advance for informations
cleber
what I have in mind is something like:  (below)
##########################################################################################
sink("simpletest.tcl")
cat('
toplevel .t
button .t.b -text "but" -command {"some tcltk command for push data into R"}
checkbutton .t.c -text "ck1" -variable "chkvar"
pack .t.b
pack .t.c '
)
sink()

library( tcltk )
#tcl('set', 'argc', '0')
#tcl('set', 'argv', '0')
tcl('source', "simpletest.tcl" )

 > tclvalue('chkvar')
[1] "1"
 > tclvalue('chkvar') # after click in screen
[1] "0"
 >

### after click in button  get error:

invalid command name "some tcltk command for push data into R"
invalid command name "some tcltk command for push data into R"
     while executing
""some tcltk command for push data into R""
     invoked from within
".t.b invoke"
     ("uplevel" body line 1)
     invoked from within
"uplevel #0 [list $w invoke]"
     (procedure "tk::ButtonUp" line 24)
     invoked from within
"tk::ButtonUp .t.b"
     (command bound to event)
  ##########################################################################################
 > sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7600)

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] tcltk     stats     graphics  grDevices utils     datasets methods   
base
 >



---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus



More information about the R-help mailing list