我一直在使用MaëlleSalmon的recommended tools来改进R包,并且无法使pkgdown :: build_site()正常工作:
> pkgdown::build_site()
Initialising site --------------------------------------------------------------------------------------------------------
Copying 'C:/Users/name/Documents/R/win-library/3.3/pkgdown/assets/jquery.sticky-kit.min.js'
Copying 'C:/Users/name/Documents/R/win-library/3.3/pkgdown/assets/link.svg'
Copying 'C:/Users/name/Documents/R/win-library/3.3/pkgdown/assets/pkgdown.css'
Copying 'C:/Users/name/Documents/R/win-library/3.3/pkgdown/assets/pkgdown.js'
Building home ------------------------------------------------------------------------------------------------------------
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-02\docs/authors.html'
Updating README.md
Building article 'index.html'
Error in stri_split_boundaries(string, n = n, simplify = simplify, opts_brkiter = opts(pattern)) :
argument `str` should be a character vector (or an object coercible to)
> traceback()
6: stop(err[[2]])
5: get_result(output = out, options)
4: callr::r_safe(function(...) rmarkdown::render(...), args = list(input,
output_format = format$format, output_file = basename(output_file),
quiet = quiet, encoding = encoding, envir = globalenv()),
show = !quiet)
3: render_rmd(pkg, input, "index.html", depth = depth, data = data,
toc = FALSE, strip_header = TRUE, encoding = encoding)
2: build_home(pkg, path = path, encoding = encoding)
1: pkgdown::build_site()
查看stri_split_boundaries
的文档我的猜测是,stringi
期望其他文件或字符串为空。因此我尝试过:
这些没有效果。这是我的第一个R包,我还没弄清楚如何正确调试这样的问题。我查看了build_home()
的源代码,但很难知道从哪里开始。现在我几乎随意地尝试着。感谢任何帮助 - 即使它是关于如何调试此类问题的更通用的建议。
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.5.0 stringr_1.1.0 runchart_0.2.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.9 whisker_0.3-2 knitr_1.15.1 xml2_1.1.1 magrittr_1.5 roxygen2_6.0.1
[7] MASS_7.3-45 pkgload_0.0.0.9000 debugme_1.0.2 R6_2.2.2 rlang_0.1.2.9000 httr_1.3.1
[13] tools_3.3.2 DBI_0.5-1 withr_2.0.0 htmltools_0.3.5 commonmark_1.2 yaml_2.1.14
[19] assertthat_0.1 digest_0.6.12 rprojroot_1.2 tibble_1.3.3 pkgdown_0.1.0.9000 crayon_1.3.2
[25] processx_2.0.0.1 callr_1.0.0.9000 purrr_0.2.3 curl_2.3 memoise_1.1.0 evaluate_0.10.1
[31] rmarkdown_1.6 stringi_1.1.2 desc_1.1.1 backports_1.0.5