rmarkdown-guide
rmarkdown-guide copied to clipboard
Error: ! object 'v_spaces' not found
- Build date: 2023/7/30
- R version: 4.2.0
- R Studio version: 2023.06.1 Build 524
- Problem:
- source code: 06-operation.Rmd
knitr:::v_spaces(c(1, 3, 6, 0))
- package: knitr 1.43
- what's diff: method
v_spaces
has been removed in v1.41. - build log:
- source code: 06-operation.Rmd
...
692/850
693/850 [unnamed-chunk-219]
694/850
695/850 [unnamed-chunk-220]
696/850
697/850 [unnamed-chunk-221]
Quitting from lines 7917-7918 [unnamed-chunk-221] (rmarkdown-guide.Rmd)
Error:
! object 'v_spaces' not found
Warning message:
In system2("python3", c("-c", shQuote(code)), stdout = TRUE) :
running command '"python3" -c "print(1 + 1)"' had status 9009
Execution halted
Error: bookdown::render_book() failed to render the output format 'bookdown::gitbook'.
Execution halted
Error: Failed to compile the book to all
Execution halted
Error in render_book_script(output_format, envir, quiet) :
Error 1 attempting to render book
Calls: <Anonymous> -> <Anonymous> -> in_dir -> render_book_script
Execution halted
Exited with status 1.
-
Possible solution: use
strrep(' ', c(1,3,6,0))
instead. -
Chinese summary 简中梗概:
由于v_spaces
函数已被废弃,章节 6.4.2 向源代码中添加行号 编译失败。通过查 knitr 源码变更 可知,使用strrep
函数是knitr作者的选择。strrep(' ', c(1,3,6,0))
的编译结果与原文效果一致。
题外话:平时我都不怎么上Github,有什么信息的话大家踢我一脚 Email me at: [email protected]