rasmusab/bayesian_first_aid

Cannot install package in R 3.6.3 (Using Google Colab)

Closed this issue · 3 comments

I am unable to install the package on R 3.6.3. I get the following error. I am using Google Colab's R notebook (colab.fan/r)

devtools::install_github("rasmusab/bayesian_first_aid")
Downloading GitHub repo rasmusab/bayesian_first_aid@master

rjags (NA -> 4-10 ) [CRAN]
coda (NA -> 0.19-3) [CRAN]
Skipping 1 packages not available: mnormt

Installing 3 packages: rjags, coda, mnormt

Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)

Error: Failed to install 'BayesianFirstAid' from GitHub:
(converted from warning) package ‘mnormt’ is not available (for R version 3.6.3)
Traceback:

  1. devtools::install_github("rasmusab/bayesian_first_aid")
  2. pkgbuild::with_build_tools({
    . ellipsis::check_dots_used(action = getOption("devtools.ellipsis_action",
    . rlang::warn))
    . {
    . remotes <- lapply(repo, github_remote, ref = ref, subdir = subdir,
    . auth_token = auth_token, host = host)
    . install_remotes(remotes, auth_token = auth_token, host = host,
    . dependencies = dependencies, upgrade = upgrade, force = force,
    . quiet = quiet, build = build, build_opts = build_opts,
    . build_manual = build_manual, build_vignettes = build_vignettes,
    . repos = repos, type = type, ...)
    . }
    . }, required = FALSE)
  3. install_remotes(remotes, auth_token = auth_token, host = host,
    . dependencies = dependencies, upgrade = upgrade, force = force,
    . quiet = quiet, build = build, build_opts = build_opts, build_manual = build_manual,
    . build_vignettes = build_vignettes, repos = repos, type = type,
    . ...)
  4. tryCatch(res[[i]] <- install_remote(remotes[[i]], ...), error = function(e) {
    . stop(remote_install_error(remotes[[i]], e))
    . })
  5. tryCatchList(expr, classes, parentenv, handlers)
  6. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  7. value[3L]

The error is pretty clearly not being able to install mnormt -- this is mentioned several times in the error message -- and not bayesian_first_aid itself. If you look at CRAN, you'll see that the current release of mnormt requires R 4.0+. R doesn't install historical versions by default. You can click on the Old Sources link to see which historical versions are archived. Judging by the release date, version 1.5.6 should be compatible with R 3.6.x. install.packages allows you to specify a URL instead of a package name:

install.packages("https://cran.r-project.org/src/contrib/Archive/mnormt/mnormt_1.5-6.tar.gz")

This works fine on my local copy of R 3.6.3.

Alternatively, you can upgrade to R 4.0.

I'm sorry. But I am unable to install.

Warning in install.packages :
package ‘https://cran.r-project.org/src/contrib/Archive/mnormt/mnormt_1.5-6.tar.gz’ is not available (for R version 3.6.3)

Since I am running Ubuntu 18.04, there are some issues while upgrading to R 4.0. It would be great if I can use 3.6 itself.

My bad. I now used remotes::install_url method to install the above package. Success!
I was also able to install BayesianFirstAid.
Thanks @palday.