r - 错误:“treesnip”的包或命名空间加载失败
问题描述
尝试使用 remotes::install_github("curso-r/treesnip") 从 github 安装 treesnip 包时,出现以下错误:
remotes::install_github("curso-r/treesnip")
Downloading GitHub repo curso-r/treesnip@HEAD
WARNING: Rtools is required to build R packages, but is not currently installed.
Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.
√ checking for file 'C:\Users\SAR.V-LOG\AppData\Local\Temp\RtmpENiM7Q\remotes38701dfb49f3\curso-r-treesnip-c70a89b/DESCRIPTION' (375ms)
- preparing 'treesnip': (736ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
Removed empty directory 'treesnip/.github/workflows'
Removed empty directory 'treesnip/.github'
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in serialize/load version 3 cannot be read in older versions of R. File(s) containing such objects: 'treesnip/inst/benchmark_parallel_processing_vignette.rds'
- building 'treesnip_0.1.0.tar.gz'
* installing *source* package 'treesnip' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'treesnip'
finding HTML links ... done
add_boost_tree_catboost html
add_boost_tree_lightgbm html
add_decision_tree_tree html
multi_predict._catboost.Model html
multi_predict._lgb.Booster html
predict_lightgbm_classification_class html
predict_lightgbm_classification_prob html
predict_lightgbm_classification_raw html
predict_lightgbm_regression_numeric html
train_catboost html
train_lightgbm html
train_tree html
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'treesnip':
.onLoad failed in loadNamespace() for 'treesnip', details:
call: NULL
error: The values passed to `set_encoding()` are missing arguments: 'allow_sparse_x'
error: loading failed
running stopped
*** arch - x64
Error: package or namespace load failed for 'treesnip':
.onLoad failed in loadNamespace() for 'treesnip', details:
call: NULL
error: The values passed to `set_encoding()` are missing arguments: 'allow_sparse_x'
Fejl: loading failed
running stopped
ERROR: loading failed for 'i386', 'x64'
* removing 'C:/Users/SAR.V-LOG/OneDrive - VELUX/Documents 1/R/R-4.0.2/library/treesnip'
Error: Failed to install 'treesnip' from GitHub:
(converted from warning) installation of package ‘C:/Users/SAR~1.V-L/AppData/Local/Temp/RtmpENiM7Q/file38706c2c7239/treesnip_0.1.0.tar.gz’ had non-zero exit status
我的会话信息():
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252
[4] LC_NUMERIC=C LC_TIME=Danish_Denmark.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2
我在另一台 PC 上运行时工作正常。我还尝试将库位置更改为 C:/Users/SAR.V-LOG/,但这也无济于事。此外,我尝试提供 INSTALL_opts = "--no-test-load"。当我这样做时,安装完成但没有错误,但是当我尝试使用 library(treesnip) 加载库时,我得到同样的错误:传递给的值set_encoding()
缺少参数:'allow_sparse_x'
您知道导致此错误的原因以及如何解决吗?
解决方案
treesnip 是固定的。它现在取决于欧洲防风草 (>= 0.1.3.9000) https://github.com/curso-r/treesnip/commit/902a33d9f156c10da6dbe1bd9cccb65926077197
推荐阅读
- python - 如何使用 Telethon 登录多个帐户...?
- mongoose - 为什么我们将 GraphQL 与 Mongoose 一起使用
- html - :nth-child 未能遵守 CSS 属性
- java - hosts 不能为空 - 创建与 MongoDB 4.2 数据库的 POJO 连接时出现异常
- php - 支付门户流程完成时,会话 cookie 会“丢失”
- r - 频率表分类值
- c# - 强制重新评估依赖属性以强制值
- html - 我的练习网页完全是空的,我不知道为什么
- python - 有没有办法在 python 中使用 Librosa 为音频信号增加增益?
- wxpython - 如何使用 wxPython Grid 和 GridTableBase?