Created
November 30, 2016 17:42
-
-
Save naomispence/75410ea83cdcb8827d543434ec4cc5ba 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
#create new temporary dataset that filters out the missing (NA) values so that they don't appear in the graph | |
polviewsnew<-dplyr::filter(GSS2014, polviews!='NA') | |
#create a bar graph using the new temporary dataset | |
ggplot(polviewsnew, aes(x=polviews)) + | |
geom_bar(stat ="count", color="red", fill="white", aes(y = ((..count..)/sum(..count..)))) + | |
ggtitle("Political Views") + | |
labs(y="Percent", x="Political Views") + scale_y_continuous(labels=percent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment