Created
October 23, 2017 15:16
-
-
Save rcatlord/641493e4c32a5e946ca4a8f77879948c 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
library(tidyverse) | |
plot <- 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") | |
plot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment