0

I want to use the BoxM() function in R from the package "biotools". However, I get the following error:

Loading required package: rpanel
Loading required package: tcltk
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") : 
[tcl] can't find package BWidget.

In addition: Warning message:
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1 
Error: package or namespace load failed for ‘rpanel’:
unable to load R code in package ‘rpanel’
Error: package ‘rpanel’ could not be loaded

What would be the problem? I already googled, but I did not succeed to find a solution (that I understand what I should do...).

Thx

  • `biotools` depends on `rpanel` which requires `BWidget` to be installed _on your system_. So you need to install BWidget (see [here](https://wiki.tcl.tk/2251)) on your computer before installing `biotools` in R. – meriops Aug 02 '18 at 14:57
  • I downloaded BWidget but I still get an error... > library("biotools",lib.loc="/Library/Frameworks/R.framework/Versions/3.4/Resources/library") Loading required package: rpanel Loading required package: tcltk Error in structure(.External(.C_dotTcl, ...), class = "tclObj") : [tcl] can't find package BWidget. Error: package or namespace load failed for ‘rpanel’: unable to load R code in package ‘rpanel’ Error: package ‘rpanel’ could not be loaded – Karel Vermeulen Aug 04 '18 at 07:46
  • I don't have a mac so I can't try, but it might require the "command line tools" to compile the package (see section 6.3.2 of the R-admin manual, although it is not overly clear). Maybe see also the release notes for the latest mac versions of R on the "Download R for (Mac) OS X" [here](https://cran.r-project.org/)... – meriops Aug 05 '18 at 12:35

1 Answers1

0

I know this is an old question, but I had the exact same problem yesterday and it took me hours to solve it. So I want to put it here just in case anyone needs it! Here are the instructions, that worked in Mac OSX El Capitan, RStudio 1.1.423 with R 3.6.0.

In order for rpanel to be installed, BWidget should be installed in /usr/local/lib

  1. Download the file from: https://sourceforge.net/projects/tcllib/files/BWidget/

  2. Extract the tar file in the directory /usr/local/lib

Also, gfortran will be required at some point in the installation (for classInt, that is required for SpatialEpi, which is required for biotools..). Go to Terminal (in Applications/Utilities/Terminal):

curl -OL http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxj gfortran-4.8.2-darwin13.tar.bz2 -C /

Now we can start installing packages in R Studio:

install.packages("rpanel", dependencies = TRUE)
install.packages("Rcpp", dependencies = TRUE)
install.packages("classInt", dependencies = TRUE)
install.packages("SpatialEpi", dependencies = TRUE)
install.packages("biotools", dependencies = TRUE)

The biotools package should be successfully installed like this. You might not even need to install the packages before because dependencies is set to TRUE, but this is the way it worked for me. My system has the development tools of Mac XCode and installed the dev-tools through Terminal:

xcode-select --install

Sources of information:

  1. For BWidget: https://stat.ethz.ch/pipermail/r-sig-mac/2006-October/003301.html

  2. For gfortran (needed to change to -OL instead of just -O): OS X package installation depends on gfortran-4.8

u-_-u
  • 23
  • 5