Skip to content

Instantly share code, notes, and snippets.

View BenjaminWolfe's full-sized avatar

Benjamin Wolfe BenjaminWolfe

View GitHub Profile
# my 15yo's homework today during lockdown
# find an equation for the cooling of a cup of coffee
# with the following temperature measurements
library(tidyverse)
decay_tbl <- tribble(
~time, ~temperature,
0, 179.5,
5, 168.7,
library(tidyverse)
library(slackteams)
library(slackr)
library(lubridate)
library(here)
library(glue)
library(conflicted)
library(fs)
conflict_prefer("filter", "dplyr", "stats" )
#' Eureka!
#'
#' Running `devtools::check()` on my Windows laptop,
#' I kept getting the following warning:
#'
#' ```
#' 'qpdf' is needed for checks on size reduction of PDFs
#' ```
#'
#' I downloaded the latest version of `qpdf` from SourceForge,
@BenjaminWolfe
BenjaminWolfe / panel-gridlines-color-vector.R
Last active August 27, 2019 14:18
If you specify a vector of gridline colors, ggplot2 cycles through them
library(tidyverse) # dplyr, stringr, ggplot2
library(lubridate)
#' The `sunspot.month` dataset as a tibble:
sunspots_reshaped <-
tibble(
sunspot_month = sunspot.month %>%
start() %>%
c(1) %>%
paste(collapse = "-") %>%