megyn
megyn

Reputation: 43

change to newer Tcl/Tk version in R

I have multiple versions of tcl and tk installed in my tcl.framework and tk.framework 8.4, 8.5 and 8.6.

On top of this, I am using R and it is always complaining with the following error

"In fun(...) : Can't find a usable tk.tcl in the following directories:"

The multiple "directories" in which it looks are incorrect and it is not even the correct version it is looking for. What I would like to do is to tell R the correct "version" I want it to use and the "correct path" it should look for the tcl/tk files.

I was tempted to add a new directory to the R-Tcl/Tk search path with "addTclPath("/custom/TclTk/path")" but how do I tell it I want it to search to a different path and use "the new" version of tcl/tk from that moment.

I am using MACOSX 10.6.

Upvotes: 0

Views: 2515

Answers (2)

Donal Fellows
Donal Fellows

Reputation: 137557

Sounds like you're using an incomplete installation of Tk. Because Tk doesn't (by default) work as just a library, but a library with supporting script files, it needs to be installed correctly for it to function. Once you're using an installed version, that message should go away. (OTOH, OSX does include a proper build of Tk as a framework IIRC; a bit old, but correct. On my OSX machine, this configuration option would work: --with-tk-config=/Library/Frameworks/Tk.framework/tkConfig.sh)

Upvotes: 0

mdsumner
mdsumner

Reputation: 29477

This is described in the R Installation and Administration Manual:

http://cran.r-project.org/doc/manuals/R-admin.html#Tcl_002fTk

The relevant section in R version 2.13.0 Patched (2011-04-19 r55523) begins with this.

A.2.1 Tcl/Tk

The tcltk package needs Tcl/Tk >= 8.4 installed: the sources are available at http://www.tcl.tk/. To specify the locations of the Tcl/Tk files you may need the configuration options . . .

Upvotes: 1

Related Questions