Skip to content
Prev 262767 / 398502 Next

Still have problems with tcltk in R 64 bit

Well, the R code in package tcltk for startup under Windows is, as you 
could have found out yourself easily:

.onLoad <- function(lib, pkg)
{
     packageStartupMessage("Loading Tcl/Tk interface ...",
                           domain = "R-tcltk", appendLF = FALSE)
     if(!nzchar(tclbin <- Sys.getenv("MY_TCLTK"))) {
         tclbin <- file.path(R.home(), "Tcl",
                             if(.Machine$sizeof.pointer == 8) "bin64" 
else "bin")
         if(!file.exists(tclbin))
             stop("Tcl/Tk support files were not installed", call.=FALSE)
         if(.Machine$sizeof.pointer == 8) {
             lib64 <- gsub("\\", "/", file.path(R.home(), "Tcl", "lib64"),
                           fixed=TRUE)
             Sys.setenv(TCLLIBPATH = lib64)
         }
     }
     library.dynam("tcltk", pkg, lib, DLLpath = tclbin)
     .C("tcltk_start", PACKAGE="tcltk")
     addTclPath(system.file("exec", package = "tcltk"))
     packageStartupMessage(" ", "done", domain = "R-tcltk")
     invisible()
}


This tells us that if you do not have "MY_TCLTK" defined on startup of 
R, you probably forgot to select the tcltk files for 64 bit from the 
installer when installing your version of R.

Uwe Ligges
On 15.06.2011 14:28, Arnaud Mosnier wrote: