tidy-tools

Building tidy tools in R, a workshop

Stars
49
Committers
3

output: github_document

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Tidy tools

Notes and live code for a 2-day workshop on "tidy tools". This workshop is (mostly) coded live. You can see the scripts I work from in script/, but I recommend not reading too far ahead because you'll find answers to some of the exercises, and you'll learn more if you try to work through them first.

Slides:

Setup

deps <- unique(sort(renv::dependencies()$Package))
deps <- setdiff(deps, c(
  "ns", # created during class
  "rmarkdown", "knitr", # only needed for .Rmd
  "countdown", # only needed for instructor
  "renv", # only needed for this block
  "itdepends", # not on CRAN
  "bizarro", # making it 
  c("stats", "MASS", "datasets"), # recommended
  c("devtools", "roxygen2", "testthat"),
  tidyverse::tidyverse_packages(),
  NULL
))
install <- c(
  'install.packages("devtools")',
  paste0("install.packages(c(", paste0(encodeString(deps, quote = '"'), collapse = ", "), "))"),
  'devtools::install_github("r-lib/itdepends")'
)
# You may also need:
install.packages(c("ggplot2", "dplyr", "stringr"))

# And get the package we'll work with later:
usethis::create_from_github("hadley/fordogs", fork = FALSE)

# if you see an error about "unsupported protocol", try this:
usethis::create_from_github("hadley/fordogs", fork = FALSE, protocol = "https")