Skip to content

Instantly share code, notes, and snippets.

@northernjamie
Last active November 18, 2016 22:20
Show Gist options
  • Save northernjamie/972276213863294a414640db13c1e41b to your computer and use it in GitHub Desktop.
Save northernjamie/972276213863294a414640db13c1e41b to your computer and use it in GitHub Desktop.
Scatterplot in R for 2nd Swirrl Article
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