Data from:
library(ggplot2)
library(ggrepel)
IncomeData = read.csv('Datasets/StateIncomeData.csv')
IncomeData = IncomeData[order(IncomeData$State),]
LifespanData = read.csv('Datasets/StateLifeExpectancy.csv')
LifespanData = LifespanData[order(LifespanData$State),]
PlotData = data.frame('State' = IncomeData$State, 'Income' = IncomeData$Median.household.income, 'Lifespan' = LifespanData$Life.Expectancy)
ShortPlotData = PlotData[1:30,]
ggplot(ShortPlotData) +
geom_point(aes(Income,Lifespan), size = 4, color = 'steelblue') +
geom_label_repel(aes(Income,Lifespan, label = State))