Skip to content

Instantly share code, notes, and snippets.

View benapie's full-sized avatar

Ben Napier benapie

View GitHub Profile
@benapie
benapie / histogram_comparison.R
Last active January 30, 2018 10:51
Histogram from a tibble (main), or any other data-frame-like data type, where data is split and scaled to density for data satisfying a condition and not satisfying a condition.
ggplot(data)+
geom_histogram(alpha = 0.5,
aes(x = Value,
y = ..density..,
fill = Condition),
position = 'identity',
binwidth = 1)