运行pkgdown::build_site()
时,出现以下错误:
Error in .Call(C_serialize_to_yaml, x, line.sep, indent, omap, column.major, :
Incorrect number of arguments (9), expecting 8 for 'serialize_to_yaml'
Calls: withCallingHandlers ... <Anonymous> -> <Anonymous> -> .handleSimpleError -> h
Execution halted
Error in .Call(C_serialize_to_yaml, x, line.sep, indent, omap, column.major, :
Incorrect number of arguments (9), expecting 8 for 'serialize_to_yaml'
通过函数链,我发现调用yaml::as.yaml(meta)
时似乎触发了该问题。这是一种无需整个程序包即可重现错误的快速方法(请注意,meta
是由pkgdown以这种形式创建的):
meta <- list(
pandoc = "2.2.2.1",
pkgdown = "1.1.0",
pkgdown_sha = NULL,
articles = list(
intermediate = "intermediate.html",
introduction = "introduction.html")
)
yaml::as.yaml(meta)
以下是我的会话信息,以帮助您:
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] yaml_2.2.0 pkgdown_1.1.0
loaded via a namespace (and not attached):
[1] roxygen2_6.1.0 Rcpp_0.12.18 digest_0.6.15 crayon_1.3.4 rprojroot_1.3-2
[6] assertthat_0.2.0 commonmark_1.5 MASS_7.3-50 R6_2.2.2 backports_1.1.2
[11] magrittr_1.5 stringi_1.2.4 rlang_0.2.1 rstudioapi_0.7 fs_1.2.4
[16] xml2_1.2.0 desc_1.2.0 tools_3.5.1 stringr_1.3.1 compiler_3.5.1
[21] memoise_1.1.0
答案 0 :(得分:0)
删除并重新安装yaml软件包即可解决此问题。