Created
October 23, 2017 15:24
-
-
Save rcatlord/4fd75107d6e91fd11eb7b22027fdac6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source("https://trafforddatalab.github.io/assets/theme/ggplot2/theme_lab.R") | |
starwars %>% | |
mutate(name, bmi = mass / ((height / 100) ^ 2)) %>% | |
ggplot(aes(x = bmi)) + | |
geom_histogram(fill = "#fc6721", alpha = 0.8, binwidth = 10) + | |
scale_x_continuous(expand = c(0, 0), limits=c(0, 450)) + | |
labs(x = "Body Mass Index [kg/m^2]", y = NULL, | |
title = "BMI distribution for Star Wars characters") + | |
theme_lab() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment