问题
I've asked this similar question before. I've done more digging and made this question as minimal and reproducible as possible:
First I created a new package as described here and built a site with pkgdown
. This builds a site as expected:
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-11-debugging-pkgdown\runchart\docs/authors.html'
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/index.html'
Building function reference --------------------------------------------------------
Creating 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/reference/'
Loading runchart
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/reference/index.html'
Processing hello.Rd
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/reference/hello.html'
But if I create a default vignette - the site no longer builds:
> devtools::use_vignette("my-vignette")
* Creating `vignettes`.
* Adding `inst/doc` to ./.gitignore
> 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-11-debugging-pkgdown\runchart\docs/authors.html'
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/index.html'
Building function reference --------------------------------------------------------
Loading runchart
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/reference/index.html'
Processing hello.Rd
Writing 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/reference/hello.html'
Building articles ------------------------------------------------------------------
Creating 'C:\Users\name\Dropbox\Rpackages\runchart-11-debugging-pkgdown\runchart\docs/articles/'
Building article 'my-vignette.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)
Here's the traceback:
> traceback()
8: stop(err[[2]])
7: get_result(output = out, options)
6: 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)
5: .f(input = "C:\\Users\\name\\Dropbox\\Rpackages\\runchart-11-debugging-pkgdown\\runchart\\docs/articles/my-vignette.Rmd",
output_file = "my-vignette.html", depth = 1L, pkg = list(
package = "runchart", path = ".", desc = <environment>,
meta = list(), topics = list(name = "hello", file_in = "hello.Rd",
file_out = "hello.html", alias = list(hello.Rd = "hello"),
usage = list(hello.Rd = list(hello())), funs = list(
hello.Rd = "hello"), title = "Hello, World!",
rd = list(hello.Rd = list(list("hello"), "\n", list(
"hello"), "\n", list("Hello, World!"), "\n",
list("\n", "hello()\n"), "\n", list("\n", "Prints 'Hello, world!'.\n"),
"\n", list("\n", "hello()\n"), "\n")), concepts = list(
hello.Rd = character(0)), internal = FALSE),
vignettes = list(file_in = "my-vignette.Rmd", file_out = "my-vignette.html",
name = "my-vignette", path = ".", vig_depth = 0L,
title = "Vignette Title"), topic_index = "hello",
article_index = "my-vignette.html"), data = list(pagetitle = "$title$"),
encoding = "UTF-8", quiet = TRUE)
4: do.call(".f", c(args, list(...)))
3: purrr::pwalk(articles, render_rmd, pkg = pkg, data = data, encoding = encoding,
quiet = quiet)
2: build_articles(pkg, path = file.path(path, "articles"), depth = 1L,
encoding = encoding)
1: pkgdown::build_site()
I've tried these same steps on Ubuntu (hello world package with hello world vignette) and pkgdown
builds a site without issue.
session info for Windows (which doesn't build):
> 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
session info for Ubuntu (which does build):
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] runchart_0.1.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.12 compiler_3.4.1 git2r_0.19.0 tools_3.4.1
[5] highlight_0.4.7.1 digest_0.6.12 pkgbuild_0.0.0.9000 pkgload_0.0.0.9000
[9] memoise_1.1.0 evaluate_0.10.1 tibble_1.3.4 rlang_0.1.2
[13] rstudioapi_0.7 commonmark_1.4 curl_2.8.1 yaml_2.1.14
[17] pkgdown_0.1.0.9000 withr_2.0.0 httr_1.3.1 stringr_1.2.0
[21] roxygen2_6.0.1 xml2_1.1.1 knitr_1.17 desc_1.1.1
[25] devtools_1.13.3 rprojroot_1.2 R6_2.2.2 rmarkdown_1.6
[29] callr_1.0.0 purrr_0.2.3 magrittr_1.5 whisker_0.3-2
[33] backports_1.1.0 clisymbols_1.2.0 htmltools_0.3.6 MASS_7.3-47
[37] usethis_0.1.0 assertthat_0.2.0 stringi_1.1.5 crayon_1.3.4
回答1:
Pkgdown imports Rmarkdown which imports stringr (>= 1.2.0).
I updated stringr on Windows from 1.1.0 to 1.2.0 and the site now builds.
来源:https://stackoverflow.com/questions/46366116/pkgdown-builds-in-ubuntu-but-not-windows-argument-str-should-be-a-character-v