Loon: An Interactive Statistical Visualization Toolkit

Linking ActiveTcl with R on Windows

We put a screencast with these instructions onto youtube here. Note that you need to install both 32bit and 64 bit Tcl.

Unfortunately R on Windows still ships with Tcl version 8.5 and loon requires Tcl version 8.6. Hence, for the near future, you need to install Tcl version 8.6 and link it with R.

Download the 32 bit and 64 bit builds of ActiveTcl version 8.6.x. You need to install both.

Install the 64 bit and 32 bit ActiveTcl under C:\Tcl64 and C:\Tcl32, respectively .

In the C:/Tcl64/bin and C:/Tcl32/bin folders copy paste the tk86.dll and tcl86.dll files (create duplications) and rename them to tk85.dll and tcl85.dll, respectively.

Create or modify the .Rprofile file in your home directory (usually in C:/Users/<your username>/.Rprofile but you can check the home path with path.expand('~') in R) to include the code below. To create the .Rprofile use Rstudio and use the menu to create a new Text File.

.First.sys()
if (.Machine$sizeof.pointer == 8) {
  Sys.setenv("MY_TCLTK"="C:/Tcl64/bin")
} else {
  Sys.setenv("MY_TCLTK"="C:/Tcl32/bin")
}

Restart R (i.e. Rstudio) and check if the above steps were successful by entering the following code in R

Sys.getenv("MY_TCLTK")

This should either return C:/Tcl32/bin or C:/Tcl64/bin. If this works enter the following code in R

library(tcltk)
tcl("set", "tcl_version")

If this returns 8.6 you were successful. Otherwise follow the steps in my youtube instructions. Note that you need to install both 32bit and 64 bit Tcl.