Skip to content

Instantly share code, notes, and snippets.

@halhen
halhen / chart.R
Last active April 22, 2017 16:54
HEIGHT <- 50 # points per column
closing_df[rep(1:nrow(closing_df), closing_df$total), ] %>%
group_by(store) %>%
mutate(rank = row_number() - 1) %>%
mutate(x = rank %/% HEIGHT,
y = rank %% HEIGHT + 0.5) %>%
arrange(y, x) %>%
mutate(rank = row_number() - 1,