我想测试已安装的软件包,但这会返回错误。
library(testthat)
test_package("testthat")
# Error: No tests found for testthat
test_package ( source here ) 返回此错误,因为system.file("tests", package = package)
它是空的。实际上,tests
安装的软件包中缺少该目录。
list.dirs(system.file("", package = "testthat"))
# [1] "/home/paul/R/x86_64-pc-linux-gnu-library/3.2/testthat/"
# [2] "/home/paul/R/x86_64-pc-linux-gnu-library/3.2/testthat//help"
# [3] "/home/paul/R/x86_64-pc-linux-gnu-library/3.2/testthat//html"
# [4] "/home/paul/R/x86_64-pc-linux-gnu-library/3.2/testthat//libs"
# [5] "/home/paul/R/x86_64-pc-linux-gnu-library/3.2/testthat//Meta"
# [6] "/home/paul/R/x86_64-pc-linux-gnu-library/3.2/testthat//R"
如何安装软件包以使其测试目录保持存在?