Random Stuff that Matters — Stian Haklev
r-languagedata-wranglingrstudioknitrggplot2literate-programming
Abstraction: Practical R data wrangling tips and workflow best practices
Key points:
- knitr enables literate programming in R: mix executable code with Markdown documentation; "Knit HTML" runs from clean slate ensuring reproducibility
- RStudio server allows geographically dispersed teams to run analyses on central datasets without distributing large files to each person
- 90% of a data scientist's job is data wrangling (acquiring, cleaning, combining data sources), not running statistical functions
- ggplot2 uses Grammar of Graphics layered approach — requires learning its DSL to use effectively; data.table is faster than data.frame for large datasets with powerful split/apply/merge
- DRY principle: abstract repeated ggplot2 code blocks into functions with parameters to ease updating plot themes across many charts
- Raw data should remain unmodified; all transformations live in reproducible scripts; separate import/cleaning scripts from analysis scripts
Connections: Rstudio · Github · Data Wrangling · Literate Programming · R Programming