Skip to content

Instantly share code, notes, and snippets.

@benapie
Last active January 30, 2018 10:51
Show Gist options
  • Save benapie/37012f8af5a99365b93c37269e7bc59e to your computer and use it in GitHub Desktop.
Save benapie/37012f8af5a99365b93c37269e7bc59e to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment