Error: package or namespace load failed for ‘glmnet’ in 1:(nrow(u5) - 1):
argument of length 0
卸载glmnet后,重新安装,仍然会有这个错误。
更改路径
.libPaths("C:\Program Files\R\R-4.2.1\library"),仍然报错。
非常顽固的错误!
sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8 LC_CTYPE=Chinese (Simplified)_China.utf8
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Matrix_1.4-1 ncvreg_3.13.0
loaded via a namespace (and not attached):
[1] lattice_0.20-45 codetools_0.2-18 foreach_1.5.2 grid_4.2.1 iterators_1.0.14 tools_4.2.1
[7] compiler_4.2.1
原因
初步判断R删除不彻底导致的,
解决方法
打开windows
的隐藏文件,将隐藏的.Rdata
文件夹删掉(Linux下是这个文件夹名,windows应该也是类似的文件夹)
如有问题及时沟通