Skip to content

Instantly share code, notes, and snippets.

View BenjaminWolfe's full-sized avatar

Benjamin Wolfe BenjaminWolfe

View GitHub Profile
library(tidyverse)
library(slackteams)
library(slackr)
library(lubridate)
library(here)
library(glue)
library(conflicted)
library(fs)
conflict_prefer("filter", "dplyr", "stats" )
# hacky but fun code to change the RStudio theme every (e.g.) 15 minutes,
# cycling through the themes in the {rsthemes} package.
# https://gist.github.com/BenjaminWolfe/fc00c480f8a7185779669d2895829069
#
# start is 9am on the day rstudio::conf(2021L) kicks off.
# applies the current theme, then starts a timer to change it periodically.
# to rotate less often (or more), adjust theme_period below.
# (fractional minutes may not work.)
# note that breaks are just based on lubridate::round_date logic.
#
#' 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 = "-") %>%