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:UsersSAR.V-LOGAppDataLocalTempRtmpENiM7Qremotes38701dfb49f3curso-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((:

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   

我在另一台电脑上运行时工作正常。我还尝试将库位置更改为C:\Users/SAR.V-LOG/,但这也没有帮助。此外,我试图提供INSTALL_--没有测试负载";。当我这样做时,安装完成时没有任何错误,但当我尝试使用库(treesnip(加载库时,我会得到同样的错误:传递给set_encoding()的值缺少参数:'allow_sparse_x'

你知道是什么原因导致了这个错误吗?我该如何修复它?

treesnip已修复。它现在取决于防风草(>=0.1.3.9000(https://github.com/curso-r/treesnip/commit/902a33d9f156c10da6dbe1bd9cccb65926077197

尝试使用parsnip 0.1.3(在本例中不是开发版本(。看起来0.1.3.9000有一些突破性的变化即将到来,这些变化将在新版本的防风草相邻包中处理。


警告消息指示:

Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.

您可能需要升级您的Rtools,可以在这里完成:https://cran.r-project.org/bin/windows/Rtools/

如果这能解决你的问题,请告诉我。


我还在这里添加了一个GitHub问题:https://github.com/tidymodels/parsnip/issues/376

最新更新