Skip to content

Instantly share code, notes, and snippets.

View tjpalanca's full-sized avatar

TJ Palanca tjpalanca

View GitHub Profile
@djnavarro
djnavarro / nse_hell.R
Created May 23, 2019 23:56
passing user expressions to inner functions, tidyeval and base
# tidyeval version: tidy_outer returns
# the user expression
#
# expr quotes you
# enexpr quotes user
tidy_outer <- function(x) {
tidy_inner(!!rlang::enexpr(x))
}
@halhen
halhen / joyplot-atus.R
Last active July 17, 2018 13:20
The daily grind - viz
library(tidyverse)
# data from https://www.kaggle.com/bls/american-time-use-survey
df.resp <- read_csv('../data/atus/atusresp.csv')
df.act <- read_csv('../data/atus/atusact.csv', col_types=cols(tustarttim = col_character(), tustoptime = col_character()))
df.sum <- read_csv('../data/atus/atussum.csv')
df.tmp <- df.act %>%
mutate(activity = case_when(trtier2p == 1301 ~ 'Exercise',