微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

`库中的错误检查点:运行 R 脚本时没有名为“检查点”的包

如何解决`库中的错误检查点:运行 R 脚本时没有名为“检查点”的包

我的系统是 debian 10,测试脚本如下:

me@pc:~$ cat << EOF >> packages.r
#!/usr/bin/Rscript
install.packages('checkpoint',quiet=TRUE,lib='/home/me/R/x86_64-pc-linux-gnu-library/3.5')
library(checkpoint)
checkpoint::setSnapshot("2020-08-26")
EOF

me@pc:~$ ./packages.r
./packages.r
also installing the dependencies ‘curl’,‘pkgcache’,‘pkgdepends’

Warning messages:
1: In install.packages("checkpoint",quiet = TRUE,lib = "/home/me/R/x86_64-pc-linux-gnu-library/3.5") :
  installation of package ‘curl’ had non-zero exit status
2: In install.packages("checkpoint",lib = "/home/me/R/x86_64-pc-linux-gnu-library/3.5") :
  installation of package ‘pkgcache’ had non-zero exit status
3: In install.packages("checkpoint",lib = "/home/me/R/x86_64-pc-linux-gnu-library/3.5") :
  installation of package ‘pkgdepends’ had non-zero exit status
4: In install.packages("checkpoint",lib = "/home/me/R/x86_64-pc-linux-gnu-library/3.5") :
  installation of package ‘checkpoint’ had non-zero exit status
Error in library(checkpoint) : there is no package called ‘checkpoint’
Execution halted

由于包checkpoint无法正确安装,我尝试直接在R shell中安装:

me@pc:~$ R
R

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos,'help()' for on-line help,or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages('checkpoint',lib='/home/me/R/x86_64-pc-linux-gnu-library/3.5')
also installing the dependencies ‘curl’,lib = "/home/me/R/x86_64-pc-linux-gnu-library/3.5") :
  installation of package ‘checkpoint’ had non-zero exit status

安装包 checkpoint 时有什么问题?

解决方法

apt install libcurl4-openssl-dev,然后这个问题就解决了。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。