Tips for coding more organized in R
  1. When making a Shiny App, put the ui section in a script called ui.R and the server in server.R. As long as they're loaded and in the same directory they will run without having to type "shinyApp(ui, server)"
  2. When you have a lot of lines of code to run simultaneously but highlighting is a drag, put all the code within {} brackets and just run the line with the end bracket, it will run all the code.
  3. Put comments on your code, and if you use at least four pound signs #### R Script will recognize it as a chapter for the outline table of contents, making it so much easier to find your sections in long scripts.
  4. Consider using Projects within RStudio, which you can read more about here: https://support.posit.co/hc/en-us/articles/200526207-Using-RStudio-Projects
2
2 comments
Danny Thompson
2
Tips for coding more organized in R
Athlete Lab
skool.com/athlete-lab
Athlete Lab helps you cultivate your ability to become an expert in data creation, communication & clarity within sports
powered by