测试结果怎么了?

 影帝 发布于 2023-01-06 21:03

我不记得有任何问题,但似乎突然,我无法安装任何包,因为testthat没有通过测试.作为一个catch-22,我也无法安装testthat,因为它不能通过它的测试.

R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

Error in library(testthat) : there is no package called 'testthat'
[Previously saved workspace restored]

> 
> install.packages("testthat")
Installing package into '/home/user/R/x86_64-pc-linux-gnu-library/3.0'
(as 'lib' is unspecified)
--- Please select a CRAN mirror for use in this session ---
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
trying URL 'http://cran.cs.wwu.edu/src/contrib/testthat_0.8.1.tar.gz'
Content type 'application/x-gzip' length 40777 bytes (39 Kb)
opened URL
==================================================
downloaded 39 Kb

Error in library(testthat) : there is no package called 'testthat'
Calls: source -> withVisible -> eval -> eval -> library
Execution halted

The downloaded source packages are in
    '/tmp/RtmpMoaIPO/downloaded_packages'
Warning message:
In install.packages("testthat") :
  installation of package 'testthat' had non-zero exit status

有没有办法绕过一次安装运行的测试或以其他方式解决这个问题,以便我可以修复我的R安装?

2 个回答
  • 我生活在互联网不佳的地方,我不想下载新版本的R及其所有依赖项来解决这个问题.所以你可以手动安装旧版本的test:http://cran.r-project.org/src/contrib/Archive/testthat/

    在版本3.0.2上,测试版本0.8.1似乎工作.下载gzip文件后,执行以下操作:

    R CMD INSTALL testthat_0.8.1.tar.gz

    2023-01-06 21:11 回答
  • 如果您使用的是Linux,则不必手动下载软件包,通过默认管理器安装依赖项(在本例中为"testthat")也可以.我有ubuntu 14.04和R 3.0.2

    sudo apt-get install r-cran-testthat
    

    运行上面的命令后,我终于可以安装漩涡了.

    2023-01-06 21:13 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有