@MeghanMHall

A Mac laptop with R stickers on it

now a
vintage
sticker!

this 2015
MacBook
Air is why I
learned R

A Mac laptop with R stickers on it

A Mac laptop with R stickers on it

you can

use R for your entire

data analysis workflow!

you don’t have to

use R for your entire

data analysis workflow!

Struggles

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

  1. can’t access data through R

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

00-setup.R

01-prep.R

02-analysis.R

03-dashboard.R

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

00-setup.R

01-prep.R

02-analysis.R

03-dashboard.R

  • document all report decisions: name, location, filters, run date, effective date
  • save data prep work for R

Struggles

RStudio screenshot showing examples of report comments: report name, location, dates

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

  1. can’t access data through R
  1. need to dashboard elsewhere

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

00-setup.R

01-prep.R

02-analysis.R

03-dashboard.R

  • handle relational data, aggregations, calculations, etc. in R
  • save all data files in a specific folder

Struggles

RStudio screenshot showing bare example of a dashboarding file, including an export to a special For Tableau folder

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

  1. can’t access data through R
  1. need to dashboard elsewhere
  1. no git/version control

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

00-setup.R

01-prep.R

02-analysis.R

03-dashboard.R

  • collaborate with yourself: use dated comments for major decisions
  • link to supporting documentation

Struggles


do as much in R as possible

focus on what’s realistic, not ideal

00-setup.R

01-prep.R

02-analysis.R

03-dashboard.R

  • collaborate with yourself: use dated comments for major decisions
  • link to supporting documentation

Big Wins

Big Wins


ease the burden of repeated reporting

transfer institutional knowledge

Big Wins


ease the burden of repeated reporting

transfer institutional knowledge

  1. develop internal packages
  • have easy access to common data sets used across multiple projects
  • document data definitions and calculations
  • track common analysis functions (and ggplot themes!)

Big Wins

gender_plot +
  mypackage::theme_brown()

ggsave("gender.png", 
       path = glue("../../Presentations/{current_year}/Images for slides"),
       width = 10, height = 5.6, units = "in", dpi = 200)

Big Wins


ease the burden of repeated reporting

transfer institutional knowledge

  1. develop internal packages
  1. leverage parameterized reporting with R Markdown/Quarto
  • many output formats!
  • useful when you have code + text + updating data + varying parameters

Big Wins

render <- function(division, year) {
  rmarkdown::render(
    "MyRMarkdownPDF.Rmd", 
    params = list(division = division, year = year),
    output_file = glue("{year}/{division}_{year}.pdf")
  )
}

purrr::map2(unique(data$sal_division), "2021-22", render)

less time reproducing

your own analysis

=

more time for the

work you find important



Thank you!


MEGHAN HALL
@MeghanMHall
meghall06
meghan.rbind.io
meghanhall6 AT gmail


slides made with Quarto 🎉