Last active
November 18, 2016 22:20
-
-
Save northernjamie/972276213863294a414640db13c1e41b to your computer and use it in GitHub Desktop.
Scatterplot in R for 2nd Swirrl Article
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
ggplot(dfmerged, aes(x=nratiodrug, y=nratioalcohol,label=areaname)) + geom_point(shape=21, size=6, color="blue",fill="red", alpha=0.3) + geom_text(data=subset(dfmerged, nratioalcohol > 1300)) + stat_smooth(method = "lm", col = "red") + ggtitle('Scatterplot Showing Drug and Alcohol-related Hospital Admissions, 2012–2013') + labs(x='Drug-related discharges, per 100,000 people', y='Alcohol-related discharges, per 100,000 people') + theme_bw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment