This is an addin for RStudio that allows formatting the currently selected R file with only a keyboard shortcut.
No need to do Ctrl+A, Ctrl+Shift+A
anymore!
Also, this uses formatR which is a superior formatter to the RStudio built-in.
First install formatR and devtools:
> install.packages(c("devtools", "formatR"))
And then install this package:
> devtools::install_github("ontherunvaro/formatFileAddin")
You can:
Tools > Addins > Keyboard Shortcuts
), orAddins
dropdown toolbarYou can either select a code chunk beforehand to format only that chunk, or select nothing in order to have the whole file formatted.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.