2 Setting Myself up for Success

2.1 Software

2.1.1 Why I Don’t Work Just in R

2.1.2 Why I Use RStudo, not something like R Commander

2.1.3 RStudio Options

Uncheck load data on start new session

2.2 Code Style

2.2.2 My style preferences

  • Spaces between things
  • Line breaks
  • Put all packages at top of script

2.3 Working with Files

2.3.1 Directory organization Use data/data-raw structure

2.4 Packages

2.4.1 Where do I find packages?

2.4.2 How do I evaluate packages?

2.5 Workflow

2.5.1 When to use .R vs .Rmd

Break up data cleaning (R script) and reporting (RMarkdown)

2.5.2 Load all data at top

2.5.3 Add sections in R scripts to enable TOC

2.6 Git/GitHub


  • Hard to get set up


  • Multiple people can work at a time
  • Version control
  • Branching

2.6.1 As compared to Google Drive, Dropbox, etc.


  • Easy


  • Only one person can work at a time
  • No version control