-1

I have installed the 'MCMCpack' package on my R using the code install.packages("MCMCpack") successfully.

also installing the dependency ‘quantreg’


  There are binary versions available but the source versions are later:
         binary source needs_compilation
quantreg   5.85   5.94              TRUE
MCMCpack  1.6-0  1.6-3              TRUE

Do you want to install from sources the packages which need compilation? (Yes/no/cancel) Yes
installing the source packages ‘quantreg’, ‘MCMCpack’

trying URL 'https://cran.rstudio.com/src/contrib/quantreg_5.94.tar.gz'
Content type 'application/x-gzip' length 1025290 bytes (1001 KB)
==================================================
downloaded 1001 KB

trying URL 'https://cran.rstudio.com/src/contrib/MCMCpack_1.6-3.tar.gz'
Content type 'application/x-gzip' length 1030533 bytes (1006 KB)
==================================================
downloaded 1006 KB

* installing *source* package ‘quantreg’ ...
** package ‘quantreg’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘quantreg’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/quantreg’
Warning in install.packages :
  installation of package ‘quantreg’ had non-zero exit status
ERROR: dependency ‘quantreg’ is not available for package ‘MCMCpack’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/MCMCpack’
Warning in install.packages :
  installation of package ‘MCMCpack’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/xp/077px4z927d5jplc0wg9701r0000gn/T/RtmpAgOlHz/downloaded_packages’

But when I enter library(MCMCpack), it returns this error message:

Error in library("MCMCpack") : there is no package called ‘MCMCpack’

What might be the problem here? There seems no issue in installing the package beforehand.

rrr
  • 361
  • 4
  • 13

1 Answers1

0

I have installed the 'MCMCpack' package on my R using the code install.packages("MCMCpack") successfully.

No, your installation of MCMCpack was unsuccessful, as is clearly indicated by the error & warning messages.

Of note,

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

This is usually the result of the Command Line Tools not having been installed (correctly). You can install the Xcode Command Line Tools with

xcode-select --install

Then re-issue

install.packages("MCMCpack")
Maurits Evers
  • 49,617
  • 4
  • 47
  • 68