Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ! object 'v_spaces' not found #87

Open
Match123 opened this issue Jul 30, 2023 · 1 comment
Open

Error: ! object 'v_spaces' not found #87

Match123 opened this issue Jul 30, 2023 · 1 comment

Comments

@Match123
Copy link

Match123 commented Jul 30, 2023

  • 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:
...
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))的编译结果与原文效果一致。

@Match123
Copy link
Author

题外话:平时我都不怎么上Github,有什么信息的话大家踢我一脚 Email me at: [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant