Skip to content

Instantly share code, notes, and snippets.

View tgerke's full-sized avatar

Travis Gerke tgerke

View GitHub Profile
# need to do this within the repo at
# https://github.com/gadenbuie/covid19-florida
library(dplyr, warn.conflicts = FALSE)
library(tidyr, warn.conflicts = FALSE)
library(readr, warn.conflicts = FALSE)
library(lubridate, warn.conflicts = FALSE)
library(ggplot2, warn.conflicts = FALSE)
library(purrr, warn.conflicts = FALSE)
library(ggiraph, warn.conflicts = FALSE)
@tgerke
tgerke / mwe.R
Last active December 13, 2019 20:39
Wide to long to wide (Abby)
# this solves the data wrangling problem described at:
# https://twitter.com/AbbyCScience/status/1205549666567368705?s=20
library(tidyverse)
library(lubridate)
dat <- tibble(
ID = 1:4,
event_1 = c(mdy("1/1/17"), mdy("2/14/18"), mdy("10/30/17"), mdy("6/10/18")),
event_2 = c(mdy("1/1/17"), mdy("2/14/18"), NA, NA),