r - pkgdown bygger i Ubuntu men ikke Windows: argument `str` skal være en tegnvektor

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg har spurgt dette lignende spørgsmål før. Jeg har gjort mere grave og lavet dette spørgsmål så minimalt og reproducerbart som muligt: ​​


Først oprettede jeg en ny pakke som beskrevet her og bygget et websted med pkgdown. Dette bygger et websted som forventet: [9]


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
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/authors.html'
Writing 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/index.html'
Building function reference --------------------------------------------------------
Creating 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/reference/'
Loading runchart
Writing 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/reference/index.html'
Processing hello.Rd
Writing 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/reference/hello.html'


Men hvis jeg opretter en standard vignet - siden opbygges ikke længere:


> 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
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/authors.html'
Writing 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/index.html'
Building function reference --------------------------------------------------------
Loading runchart
Writing 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/reference/index.html'
Processing hello.Rd
Writing 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/reference/hello.html'
Building articles ------------------------------------------------------------------
Creating 'C:Users
ameDropboxRpackages
unchart-11-debugging-pkgdown
unchartdocs/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)


Her er sporingen:


> 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"), "
", list(
                   "hello"), "
", list("Hello, World!"), "
", 
                   list("
", "hello()
"), "
", list("
", "Prints 'Hello, world!'.
"), 
                   "
", list("
", "hello()
"), "
")), 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()


Jeg har prøvet disse samme trin på Ubuntu (Hej World Package med Hej World Vignette) og pkgdown opbygger et websted uden problem.


session info til Windows (som ikke bygger):


> 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 til Ubuntu (som bygger):


> 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

Bedste reference


Pkgdown import Rmarkdown, som importerer strengr (>=1,2,0). [10] [11]


Jeg opdaterede stringr på Windows fra 1.1.0 til 1.2.0 og siden bygger nu.