Skip to content

read variable global in R tcltk

2 messages · Handayani Situmorang, Philippe GROSJEAN

#
Read ?tclvalue.
For instance, you can do:
 > tclvalue("tcl_library")	# Read the content of a Tcl variable
[1] "/usr/local/lib/tcl8.4"
 > .Tcl("set myvar 1")		# Create a variable inside Tcl
<Tcl> 1
 > tclvalue("myvar")		# Read its value
[1] "1"

To make sure you create global variables in Tcl, start their names with 
'::', like '::myglobalvar', if you like.
Best,

Philippe Grosjean
Handayani Situmorang wrote: