gpt4 book ai didi

r - 错误 : (converted from warning) package ‘glmnet’ is not available (for R version 3. 5.3)

转载 作者:行者123 更新时间:2023-12-04 04:14:21 49 4
gpt4 key购买 nike

我已经尝试了很多方法来让它工作,但我没有任何运气。我正在使用 Debian 8,我刚刚重新下载了 R,即获得了操作系统的最高版本。我正在下载一个 glmnet 作为其包之一的 github 包,我收到以下错误:

Error: (converted from warning) package ‘glmnet’ is not available (for R version 3.5.3)

我知道还有其他与此类似的帖子,但我已经尝试了所有这些帖子,但它们仍然不起作用。我真的需要使用例如Debian 9 然后获得更高版本以便能够使用 glmnet 还是有更简单的解决方法?

更新

我尝试了 RyanFrost 的建议,它让我更进一步,但现在我在 glmnet 包中遇到错误。第一次运行命令时,我收到有关包格的错误。我运行了 install.packages("lattice") 并重新运行了下面的代码。现在我遇到了这些错误:

> install_version("glmnet", version = "3.0")
Downloading package from url: https://cloud.r-project.org/src/contrib/Archive/glmnet/glmnet_3.0.tar.gz
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘glmnet’ ...
** package ‘glmnet’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -fstack-protector-strong -c glmnet5dpclean.f -o glmnet5dpclean.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c glmnet_init.c -o glmnet_init.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c pb.c -o pb.o
pb.c: In function ‘setpb_’:
pb.c:21:3: warning: implicit declaration of function ‘R_GetCurrentEnv’ [-Wimplicit-function-declaration]
eval(s, R_GetCurrentEnv());
^
pb.c:21:11: warning: passing argument 2 of ‘Rf_eval’ makes pointer from integer without a cast
eval(s, R_GetCurrentEnv());
^
In file included from pb.c:1:0:
/usr/share/R/include/Rinternals.h:955:6: note: expected ‘SEXP’ but argument is of type ‘int’
SEXP Rf_eval(SEXP, SEXP);
^
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o glmnet.so glmnet5dpclean.o glmnet_init.o pb.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/glmnet/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘glmnet’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/site-library/glmnet/libs/glmnet.so':
/usr/local/lib/R/site-library/glmnet/libs/glmnet.so: undefined symbol: R_GetCurrentEnv
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/glmnet’
Error: Failed to install 'unknown package' from URL:
(converted from warning) installation of package ‘/tmp/RtmpAoQtn8/remotes75e4327440a/glmnet’ had non-zero exit status

最佳答案

glmnet 包在 glmnet 3.0 版(3.0-1 以后)之后开始要求 R 3.6 版。

因此,要尝试的一件事是安装 3.0 版(只需要 R 3.5+)。

您可以为此使用开发工具:

library(devtools)

install_version("glmnet", version = "3.0")

关于r - 错误 : (converted from warning) package ‘glmnet’ is not available (for R version 3. 5.3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61036656/

49 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com