What does this error mean when I try and install the Mosaic package in R?

1.3k Views Asked by At

When I try and install the mosaic package in R studio, I get the following messages:

> install.packages('mosaic', dependencies = TRUE)
Warning in install.packages :
  dependencies ‘latticeExtra’, ‘fastR’ are not available
also installing the dependency ‘rgl’


  There are binary versions available but the source versions are later:
         binary   source needs_compilation
rgl    0.100.50 0.100.54              TRUE
mosaic    1.5.0    1.6.0             FALSE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) No
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/rgl_0.100.50.tgz'
Content type 'application/x-gzip' length 4709273 bytes (4.5 MB)
==================================================
downloaded 4.5 MB


The downloaded binary packages are in
    /var/folders/c8/lyjrvw_x18q2trr07z2s7m8w0000gn/T//RtmpOfzCf6/downloaded_packages
installing the source package ‘mosaic’

trying URL 'https://cran.rstudio.com/src/contrib/mosaic_1.6.0.tar.gz'
Content type 'application/x-gzip' length 12425406 bytes (11.8 MB)
==================================================
downloaded 11.8 MB

ERROR: dependency ‘latticeExtra’ is not available for package ‘mosaic’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mosaic’
Warning in install.packages :
  installation of package ‘mosaic’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/c8/lyjrvw_x18q2trr07z2s7m8w0000gn/T/RtmpOfzCf6/downloaded_packages’

How can I avoid this? I have tried saying both Yes and no on the following line:

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) No

And get an error both times. When I say yes and it attempts to install rgl I repeatedly get this message:

You have not agreed to the Xcode license agreements, please run 'sudo xcodebuild -license' from within a Terminal window to review and agree to the Xcode license agreements.

When I run xcodebuild -license in my terminal window it asks me for a password but does not allow me to type anything in the password slot and does not continue to install.

Is there any other way I can install the mosaic package?

2

There are 2 best solutions below

2
On

It seems its dependencies are not installed yet. Maybe install the following packages first: latticeExtra and fastR

install.packages("latticeExtra")
install.packages("fastR")
0
On

I'm clearing a backlog as my semester winds down. Sorry I didn't get to this sooner.

Short answer: a new version of mosaic is on CRAN, and this issue should go away if you install the new version.

The particular issue you were having looks like it was related to an archived package that was suggested (i.e., not required) by the mosaic package. That package is no longer in the dependency list for mosaic.

In general, when I have issues like this, I often find that manually installing the packages listed in imports: and depends: in the DESCRIPTION file of a package will either (a) resolve the problem or (b) identify exactly where the problem lies.