[R] tcltk installation problem in R (Mac OS X version)

David Winsemius dwinsemius at comcast.net
Fri Sep 14 06:48:12 CEST 2012


On Sep 13, 2012, at 8:05 PM, Nitin Bhardwaj wrote:

> Hi all, I just installed R on my Mac OS X machine

How did you do that?  (... and please don't reply to this message in r-help. It should go to R-SIG-Mac and I am adding that address. You should delete the r=help address when you reply)

> and wanted to installed
> tcl/tk. So, I installed tcl/tk from this page:
> http://cran.r-project.org/bin/macosx/tools/
> 
> It gets placed in /usr/local dir.
> and then I installed R.
> 
> Next, in R, I set the TCL_LIBRARY variable by saying
> Sys.setenv(TCL_LIBRARY="/usr/local/lib/tcl8.5")
> and
> Sys.setenv(TK_LIBRARY="/usr/local/lib/tk8.5")

When I do 
> Sys.getenv("TK_LIBRARY")
#I get an empty string
[1] ""
> 
>  But still when I try to run any GUI-based program,

Exactly what does "any" mean or can you give a specific example?

> it gives me the error
> that TCL/TK were not istalled.
> 
> In tclRequire(tclPkg) : Tcl package 'BWidget' not found
> 
> I have a suspicion that I am not setting the TCL_LIBRARY right. When I try
> to set the TCL_VARIABLE to /usr/bin  even then it does not work. What am I
> doing wrong? Please help.

I'm pretty sure that tcltk is one of the default packages that come with the standard MacOS R package. I don't remember needing to any separate install and tcltk gets loaded with many of the packages that need it but it doesn't appear in the package installer menu (as do not stats or base of grDevices). It's listed as a base package:

( From my sessionIfo() : )

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

I think you need to follow protocol:

post to the right list
 and
post sessionInfo()

-- 

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list