我在 Rstudio (Windows 0.98.1056) 中运行 testthat,我收到以下错误。它似乎是在我更新 Rstudio 和安装的 R 包之后出现的,但我怀疑这两者可能没有直接关系。该错误也发生在一个非常简单的测试文件上。有没有人遇到过这个?
文件:测试/test-all.R
library(testthat)
library(matrixUtils)
test_package("matrixUtils")
文件:测试/testthat/matrixUtils-test.R
context("testa")
test_that("subsetting by one dimension", {
a <-1
expect_equal(a, 1)
})
错误信息:
==> Sourcing R files in 'tests' directory
Error: '\.' is an unrecognized escape in character string starting "'\." Execution halted
Exited with status 1.
sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-w64-mingw32/x64 (64-bit)
locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages: [1] grid stats graphics grDevices utils datasets methods base
other attached packages: [1] magrittr_1.1.0 matrixUtils_0.2 testthat_0.8.1 dplyr_0.2.0.99 reshape2_1.4 ggplot2_1.0.0 gridExtra_0.9.1 [8] zoo_1.7-11
loaded via a namespace (and not attached): [1] assertthat_0.1 colorspace_1.2-4 digest_0.6.4 gtable_0.1.2 lattice_0.20-29 MASS_7.3-34 munsell_0.4.2 [8] parallel_3.1.1 plyr_1.8.1 proto_0.3-10 Rcpp_0.11.2 scales_0.2.4 stringr_0.6.2 tools_3.1.1
>