Error in stri_split_boundaries(): argument `str` should be a character vector

大憨熊 提交于 2019-12-11 05:09:24

问题


I've been working through Maëlle Salmon's recommended tools for improving R packages and cannot get pkgdown::build_site() working:

> 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()

Looking at the documentation for stri_split_boundaries my guess is that some file or string is empty when stringi expects otherwise. Therefore I have tried:

  1. Creating an NEW.md file (there wasn't one before)
  2. Documenting the package (as opposed to functions in the package) as described here
  3. Deleting an empty script I was using for experiments

These have no effect. This is my first R package and I haven't figured out how to properly debug issues like this. I've looked through the source code of build_home() but it's difficult to know where to start. Right now I'm resorting to trying things almost at random. Appreciate any help - even if it's more generic advice on how to debug issues like this.

> 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 

来源:https://stackoverflow.com/questions/45870948/error-in-stri-split-boundaries-argument-str-should-be-a-character-vector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!