yihui / formatR

Format R Code Automatically
https://yihui.org/formatr/
254 stars 52 forks source link

Use formatR with Rmarkdown? #72

Open oli666 opened 7 years ago

oli666 commented 7 years ago

Hi, probably more a feature request than an issue. formatR does current not work out-of-the-box with a complete markdown file using "tidy_file", does it? Sub-question: Is there a way in RStudio to use the formatR addin on a specific chunk only? Selecting the chunk before running the addin does not do the trick for me. Thanks, Oli

yihui commented 7 years ago

No, it cannot format an Rmd file at the moment.

RE: the addin, please feel free to improve it here: https://github.com/rstudio/addinexamples/blob/master/R/reformatAddin.R

rpietro commented 6 years ago

agree with @oli666 , the ability to format code inside Rmd chunks would be outstanding