Ilkay Isik
Ilkay Isik

Reputation: 213

Can't install ggstatsplot due to a configuration failure for package ‘Rmpfr’ in Mac OS Mojave

I am trying to install the r package ggstatsplot but having an issue with a package called Rmpfr.

library(ggstatsplot)

Error: package or namespace load failed for ‘ggstatsplot’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘Rmpfr’

Then when I want to install the required package:

install.packages('Rmpfr')


There is a binary version available but the source version is later:
          binary source needs_compilation
    Rmpfr  0.8-1  0.8-3              TRUE
    
    Do you want to install from sources the package which needs compilation? (Yes/no/cancel) Yes
    installing the source package ‘Rmpfr’
    
    trying URL 'https://cran.rstudio.com/src/contrib/Rmpfr_0.8-3.tar.gz'
    Content type 'application/x-gzip' length 642705 bytes (627 KB)
    ==================================================
    downloaded 627 KB
.
.
.
.
    checking mpfr.h usability... no
    checking mpfr.h presence... no
    checking for mpfr.h... no
    configure: error: Header file mpfr.h not found; maybe use --with-mpfr-include=INCLUDE_PATH
    ERROR: configuration failed for package ‘Rmpfr’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rmpfr’
    Warning in install.packages :
      installation of package ‘Rmpfr’ had non-zero exit status

I have no idea what does this mean. Could you please help solve this issue?

Upvotes: 2

Views: 618

Answers (1)

user2051942
user2051942

Reputation: 46

You need to install the mpfr library on your Mac to get the missing mpfr.h header required to compile Rmpfr. The easiest way to install mpfr is via homebrew with the following command.

brew update
brew install mpfr

You can learn more about Homebrew at https://brew.sh/.

Upvotes: 3

Related Questions