Not able to install PMCMR package in R studio

Hi I am trying to install PMCMRplus package and cannot install it as it is asking for dependencies.
I found this information but it looks like it is a terminal install. https://www.rdocumentation.org/packages/PMCMRplus/versions/1.9.0

Is there another way I can install?
THankyou

A package can not work without its required dependencies so the only way is to install them. What is your problem installing the dependencies?

I tried installing dependencies, I think for this it requires mpfr and gmp.
However when I install them, I get a warning package ‘mpfr’ is not available (for R version 3.6.1). Do I need a specific version version of R?

To reframe my question much clearly: I found this in README:

Installation under Windows

As R packages for Windows are distributed in binary form, there should not be any problem with the installation. Simply run from within R the following function:

install.packages("PMCMRplus")

R will automatically install all the relevant dependencies.

However I am using MAC and I am not able to install dependencies either and I am getting the "warning package ‘mpfr’ is not available (for R version 3.6.1)" .
So is there something specific I need to do to install on MAC? Do I need to upgrade my R version? Why is R not automatically installing all dependencies ?

Better than a description would be to look at the actual error message, I suspect you are omitting some important parts, most likely a missing system dependency, please post the complete error message you get.

Thankyou, here is the error message.

> update.packages("PMCMRplus")
> library(PMCMRplus)
Error: package or namespace load failed for ‘PMCMRplus’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘Rmpfr’
 install.packages("Rmpfr")
Installing package into ‘/Users/*******/Library/R/3.6/library’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
      binary source needs_compilation
Rmpfr  0.8-1  0.8-2              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-2.tar.gz'
Content type 'application/x-gzip' length 653754 bytes (638 KB)
==================================================
downloaded 638 KB
* installing *source* package ‘Rmpfr’ ...
** package ‘Rmpfr’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
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 ‘/Users/*****/Library/R/3.6/library/Rmpfr’
Warning in install.packages :
  installation of package ‘Rmpfr’ had non-zero exit status
The downloaded source packages are in
	‘/private/var/folders/kf/******/T/*****/downloaded_packages’

As I suspected, you are missing a system dependency, you need to install the mpfr library in your system (not in R), if you have homebrew you can use this command on a terminal.

brew install mpfr
1 Like

Oh I see. Will install it. Thankyou , hope this will take care of it. If not I will post here again :slight_smile:

Reading the documentation I think you may also need to install the gmp library.

brew install gmp
1 Like

Thank you! I had tried that before but either way the issue now is I don't have brew and I am getting that installed by my IT ,as I am not the sudo. Will try that first and run the two commands you provided and hopefully that will resolve the issue. Thank you again for your time ! I appreciate it very much!

To update on the installation.
On the terminal :
I got the homebrew installed on my personal MAC ( even though it says you don't need to be sudo to install homebrew, i realized you need to, or maybe it was my company's setting on work laptop! I tried installing homebrew in local but did not work. so I switched to my personal mac.)
then did the brew install mpfr. This automatically also installed gmp. So there was no need to do brew install gmp.
In R studio:

  1. I did install.packages("PMCMRplus") and everything got installed fine !
  2. library("PMCMRplus")
    Warning message:
    package ‘PMCMRplus’ was built under R version 3.6.2
    even though I got a warning it loaded !
    Thankyou andresrcs for all your help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.