简体   繁体   中英

tcltk not loading and causes R-gui to become unresponsive or crash

I've run into a problem with getting tcltk to run properly on r-gui. It's a required package for one of the packages (aplpack) I'd like to work with.


Preliminary Stuff
13" Macbook Air
OSX Yosemite - Version 10.10.5
R Version 3.2.3
R.app GUI 1.66 (6956) x86_64-apple-darwin14.5.0

r and r-gui were installed via homebrew


I installed aplpack in order to use the bagplot function. Upon loading the package I received the following output:

Loading required package: tcltk 2015-12-23 09:44:11.134 R[6529:31353] -[NSApplication _setup:]: unrecognized selector sent to instance 0x60800011b3f0 2015-12-23 09:44:11.135 R[6529:31353] *** run_REngineRmainloop: exception -[NSApplication _setup:]: unrecognized selector sent to instance 0x60800011b3f0 caught during REPL iteration. Update to the latest GUI version and consider reporting this properly (see FAQ) if it persists and is not known. Consider saving your work soon in case this develops into a problem.

The session became unresponsive and I had to force quit.

To try and solve the problem, I checked to see if tcltk was installed:

 > capabilities()["tcltk"] 

tcltk
TRUE

It was also available via the package manager but trying to load it, both through the gui and using library("tcltk") caused R to become unresponsive and resulted in an identical error:

2015-12-23 09:49:24.370 R[6571:33844] -[NSApplication _setup:]: unrecognized selector sent to instance 0x608000108f70 2015-12-23 09:49:24.370 R[6571:33844] *** run_REngineRmainloop: exception -[NSApplication _setup:]: unrecognized selector sent to instance 0x608000108f70 caught during REPL iteration. Update to the latest GUI version and consider reporting this properly (see FAQ) if it persists and is not known. Consider saving your work soon in case this develops into a problem.

Some googling led me to do the following:

  • uninstall r-gui via homebrew
  • uninstall r via homebrew
  • download and install the most recent version of xquartz
  • installed homebrew/dupes/tcl-tk (which I thought was supposed to fix the issue)
  • ran brew update
  • ran brew upgrade
  • ran brew doctor
  • installed r via homebrew
  • installed r-gui via homebrew

After taking the above steps, I'm still running into the same issue as before. Here is the output of sessionInfo():

sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-apple-darwin14.5.0 (64-bit) Running under: OS X 10.10.5 (Yosemite)

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

Following the advice in the Mac OSX FAQ (to attempt to replicate the issue), I opened the r in terminal and was able to not only load tcltk, but also aplpack:

R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin14.5.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-apple-darwin14.5.0 (64-bit) Running under: OS X 10.10.5 (Yosemite)

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

library("aplpack") Loading required package: tcltk sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-apple-darwin14.5.0 (64-bit) Running under: OS X 10.10.5 (Yosemite)

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages: [1] aplpack_1.3.0


I believe that the issue with loading tcltk is interfering with loading aplpack and that something in R.app/r-gui is not playing nicely with tcltk.

To my understanding

install.packages("tcltk")

Returns

package 'tcltk' is not available (for R version 3.2.3)

A work around would be to use the previous version of R which is compatible with tcltk.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM