Search code examples
rinstallationbioconductor

Installing ProStaR on mac


I am trying to install the ProStaR and DAPAR packages with Rstudio (R version 3.6.3). Following the instructions from the instruction manual (https://www.bioconductor.org/packages/release/bioc/vignettes/DAPAR/inst/doc/Prostar_UserManual.pdf) after running the following code:

if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install(version='3.10')

BiocManager::install("DAPAR")
BiocManager::install("Prostar")


library(Prostar)
Prostar()

I receive the following error messages:

>library(Prostar)
Error: package or namespace load failed for ‘Prostar’:
 .onLoad failed in loadNamespace() for 'shiny', details:
  call: NULL
  error: invalid version specification ‘1,5’
> Prostar()
Error in Prostar() : could not find function "Prostar" 

When trying to separately install the shiny package:

install.packages("shiny")
library("shiny")

I get the same error message:

Error: package or namespace load failed for ‘shiny’:
 .onLoad failed in loadNamespace() for 'shiny', details:
  call: NULL
  error: invalid version specification ‘1,5’

I have to mention that I'm not extremely familiair with R yet. Any help would be greatly appreciated.


Solution

  • You did not include versions of several items in your setup so it's possible this comes from mismatching components (rather than my initial guess that it was due to a corrupt package from whatever mirror was being used.) I needed to upgrade to R 3.6.3 to match that aspect of your set up and in the process noted that Catalina OS users need a different version of R. I'm on Mojave, so my version now produces this on startup:

    R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
    Copyright (C) 2020 The R Foundation for Statistical Computing
    Platform: x86_64-apple-darwin15.6.0 (64-bit)
    

    I then needed to update my BioConductor installation which was fairly quick but installing the DAPAR package takes a loooong time because of an extensive list of dependencies, some of which have unmet dependencies that required repeated attempts to get the process to completion. Then the Prostar package installation had another batch of unmet dependencies. After finally getting all the unmet dependencies installed, I'm unable to reproduce the error, so I'm thinking you should probably use another repository. I suggest first doing something like:

    options(repos = "https://cloud.r-project.org/")
    

    Or choose that mirror specification from the Rstudio setup panel. Then make another attempt.

    I suppose it's possible that this issue arises because of a version mismatch of compilers. The CRAN page for MacOS says clang 7 is needed. In my setup I get this (in a Terminal window)

    Comutername:~ myusername$ clang --version
    Apple clang version 11.0.0 (clang-1100.0.33.12)
    Target: x86_64-apple-darwin18.7.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    

    And for gfortran I get:

    GNU Fortran (GCC) 4.2.3
    Copyright (C) 2007 Free Software Foundation, Inc.
    

    I did all the R package installations from the R.app interface, so I suppose it's possible that some infelicity in Rstudio's package install process will be needed to explain this. Obviously all teh system installations such as clang and gfortran (and probably PROJ and other GIS packages) would need to be done from the Terminal command line. Sometimes it is safer to do all these installations from a minimal interface, possibly even from R running in a Terminal window. I've generally had good luck with R.app (over a span of 12 years) and less consistent results with Rstudio.