ggplot(starwars, aes(x=height, fill=sex)) +
geom_density(fill="skyblue") +
theme_bw() +
facet_wrap( ~ sex, scales = "free_y")
I don't want hermaphroditic or none to show up, but I can't seem to get rid of them. Thanks.
ggplot(starwars, aes(x=height, fill=sex)) +
geom_density(fill="skyblue") +
theme_bw() +
facet_wrap( ~ sex, scales = "free_y")
I don't want hermaphroditic or none to show up, but I can't seem to get rid of them. Thanks.
This should do what you want:
ggplot(data=subset(starwars, sex!="hermaphroditic" & sex!="none"), aes(x=height, fill=sex)) +
geom_density(fill="skyblue") +
theme_bw() +
facet_wrap( ~ sex, scales = "free_y")