david wei
david wei

Reputation: 51

Install "gradethis" package for code checking in "learnr"

I am creating the interactive tutorials for R for presentation using "learnr" package. For code checking, I need the package "gradethis". When I try to install this package by

" remotes::install_github("rstudio-education/gradethis") "

it gives the error message: . . .

** byte-compile and prepare package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace ‘learnr’ 0.10.1 is being loaded, but >= 0.10.1.9007 is required ERROR: lazy loading failed for package ‘gradethis’ ─ removing ‘/private/var/folders/r2/3nmkgqc51q54tmhxl00tsk2908fpk9/T/RtmpaPONJB/Rinst15003850258d/gradethis’ ----------------------------------- ERROR: package installation failed Error: Failed to install 'gradethis' from GitHub: . . .

The error message shows "‘learnr’ 0.10.1 is being loaded, but >= 0.10.1.9007 is required", however on CRAN, 0.10.1 is the latest version:

https://cran.r-project.org/web/packages/learnr/index.html

Can anyone help for this case? Many thanks.

The following show sessionInfo()

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.5.1       rjson_0.2.20         plyr_1.8.6          
 [4] markdown_1.1         htmltools_0.5.1.9000 tools_3.5.1         
 [7] base64enc_0.1-3      yaml_2.2.1           Rcpp_1.0.6          
[10] rmarkdown_2.6        knitr_1.31           xfun_0.20           
[13] digest_0.6.27        tutorial_0.4.3       rlang_0.4.10.9000   
[16] evaluate_0.14 

Upvotes: 2

Views: 1051

Answers (2)

grrrck
grrrck

Reputation: 1111

Since gradethis is still in a developmental/experimental phase, it is currently only available through GitHub at rstudio/gradethis. gradethis currently requires the developmental version of learnr which is also not yet on CRAN.

Installing both packages from their GitHub repositories will likely resolve your issues:

# install.packages("remotes") # require {remotes}
remotes::install_github("rstudio/learnr")
remotes::install_github("rstudio/gradethis")

Edit: The gradethis repository is now hosted under the rstudio GitHub organization.

Upvotes: 3

jared_mamrot
jared_mamrot

Reputation: 26695

Reproduced the error (macOS Big Sur 11.1 / Rstudio 1.3.1093 / R version 4.0.3) and solved the issue by uninstalling learnr with remove.packages("learnr") then installing gradethis with dependencies (including the required version of learnr) using remotes::install_github("rstudio-education/gradethis").

If you get a warning that "Skipping install of 'gradethis' from a github remote, the SHA1 has not changed since last install", use the command remotes::install_github("rstudio-education/gradethis", force = TRUE)

Successfully installing the packages requires the ability to compile from source (instructions for macOS Big Sur: https://stackoverflow.com/a/65334247/12957340)

Upvotes: 1

Related Questions