Jennifer Bryan RStudio, University of British Columbia @JennyBryan @jennybc bit.ly/jenny-earl Go here for useful links to stuff mentioned in this talk!!
One folder per project That folder is an • RStudio Project (package? website? whatever) • Git repo, with associated GitHub remote Work on multiple projects at once w/ multiple instances of RStudio • Each gets own child R process • R & file browser have sane working directory
If the first line of your #rstats script is setwd("C:\Users\jenny\path\that\only\I\have"), I will come into your lab and SET YOUR COMPUTER ON FIRE . — Mash-up of rage tweets by @jennybc and @tpoi.
Use here package to build paths within a Project Paths are robust to different working directories within the Project • Render .R and .Rmd that live in sub-folders! • Write paths in tests and vignettes w/o fear! here wraps the more powerful rprojroot package
maybe you don’t, because it’s too painful for loops apply(), [slvmt]apply(), split(), by() with plyr: [adl][adl_]ply() with dplyr: df %>% group_by() %>% do() How do you do such things today?