formatR Format R code automatically. See the package homepage https://yihui.org/formatR/ for more information. You can also try a live demo at https://yihui.shinyapps.io/formatR/. It can reformat your code from to