简体   繁体   中英

Installing “loo” package in R - source vs binary?

I am trying to install the "loo" package in R as it is a dependency for another library I am trying to run ("rethinking"). It keeps failing. At first I got an error saying that loo only runs on R >= 3.1.2 (I was running 3.0.1) so I did an update to 3.1.2. Now I try and install the package it it says

package 'loo' is available as a source package but not as a binary

Warning message: package 'loo' is not available (for R version 3.1.2)

I don't understand how it is not available for R version 3.1.2 after one night? Is there a way to install a source package differently? I am working on a mac, if that helps.

You were two major versions of R behind the current version, and now are only one major version behind (but very soon to again be 2 versions back). CRAN repositories compile binaries for the current version for use by Mac and Windows users in those situations where they will compile successfully on the CRAN installation of those machines. It's possible for packages to not compile on anything except Linux. Some (but not all) of the repositories will then make available older versions of the binary versions of packages. Generally the process of "binarization" is not immediate and it is not unusual for it to take a few days for binaries of updated packages to appear. Do make sure that your repo is up-to-date. The current "Version:" is 0.1.6 although earlier versions are available and appear to have been also requiring R 3.1.2 at least back to version 0.1.3: https://cran.r-project.org/src/contrib/Archive/loo/

My guess (after looking at the package website on GitHub) is that you are just getting a standard message that hints that you might need to specify needing the source package simply because your are not using the current R "major" version. Fortunately for you the 'loo'-package does not need to have any code compiled, so it should succeed even if you do not have the development tools installed for your unstated operating system. So try:

install.packages('loo', dependencies=TRUE, type="source")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM