Created
February 10, 2016 17:36
-
-
Save luiscruz/40c444c38ae6608a23fa to your computer and use it in GitHub Desktop.
Use facet_wrap to compare a variable (friend_count) distribution according to the value of another variable (gender)
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(ggplot2) | |
pf <- read.delim("https://s3.amazonaws.com/udacity-hosted-downloads/ud651/pseudo_facebook.tsv") | |
qplot(data=subset(pf, !is.na(gender)), x=friend_count, binwidth=25)+ | |
scale_x_continuous(limits = c(0,1000), breaks=seq(0,1000,50))+ | |
facet_wrap(~gender) |
Author
luiscruz
commented
Feb 10, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment