Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法重新格式化 Rmarkdown 文档中的所有代码块?
我有需要重新格式化代码的 Rmarkdown 文档,但我无法选择全部并使用 Rstudio 重新格式化代码。
包样式器可以重新格式化 Rmarkdown 文件。
library(styler) style_file("badlyFormattedFile.Rmd")
它还可以使用重新格式化目录中的所有 Rmd 或 R 脚本
style_dir("directoryWithUglyFiles")