Is there a way to reformat all code chunks in an Rmarkdown document?
I have Rmarkdown documents which need code reformatting but I can't select all and use the Rstudio reformat code.
The package styler can reformat Rmarkdown files.
library(styler)
style_file("badlyFormattedFile.Rmd")
It can also reformat all Rmd or R scripts in a directory using
style_dir("directoryWithUglyFiles")