1

我正在使用“learnr”包为 R 创建交互式教程以进行演示。对于代码检查,我需要包“gradethis”。当我尝试通过

" 遥控器::install_github("rstudio-education/gradethis") "

它给出了错误信息:。. .

** 字节编译并准备包以进行延迟加载 loadNamespace 中的错误(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'learnr ' 0.10.1 正在加载,但 >= 0.10.1.9007 是必需的--------------------------------- 错误:软件包安装失败错误:无法从 GitHub 安装“gradethis”:。. .

错误消息显示“正在加载'learnr' 0.10.1,但需要 >= 0.10.1.9007”,但是在 CRAN 上,0.10.1 是最新版本:

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

任何人都可以帮助这个案子吗?非常感谢。

下面的节目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 
4

2 回答 2

3

由于gradethis仍处于开发/实验阶段,因此目前只能通过 GitHub 的rstudio/gradethis 获得。Gradethis 目前需要学习者的开发版本,版本还没有在 CRAN 上。

从他们的 GitHub 存储库安装这两个包可能会解决您的问题:

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

编辑:gradethis 存储库现在托管在rstudioGitHub 组织下。

于 2021-02-03T18:42:10.677 回答
1

重现了错误(macOS Big Sur 11.1 / Rstudio 1.3.1093 / R 版本 4.0.3)并通过卸载 learnr 并remove.packages("learnr")使用remotes::install_github("rstudio-education/gradethis").

如果您收到“从 github 远程跳过安装 'gradethis',SHA1 自上次安装以来未更改”的警告,请使用命令remotes::install_github("rstudio-education/gradethis", force = TRUE)

成功安装软件包需要能够从源代码编译(macOS Big Sur 的说明:https ://stackoverflow.com/a/65334247/12957340 )

于 2021-02-01T22:17:04.830 回答