October 17, 2024
gtExtras
packagegtExtras
lets us include sparklines, histograms, etc. in our tables15:00
name | estimate | lower_90 | upper_90 |
---|---|---|---|
Barnstable | 40442 | 39554 | 41330 |
Berkshire | 33040 | 32074 | 34006 |
Bristol | 36910 | 36347 | 37473 |
Dukes | 40119 | 34791 | 45447 |
Essex | 39756 | 39174 | 40338 |
Franklin | 34775 | 33712 | 35838 |
Hampden | 32262 | 31707 | 32817 |
Hampshire | 30795 | 29868 | 31722 |
Middlesex | 51808 | 51337 | 52279 |
Nantucket | 45717 | 38260 | 53174 |
Norfolk | 52591 | 51991 | 53191 |
Plymouth | 43684 | 43014 | 44354 |
Suffolk | 39200 | 38624 | 39776 |
Worcester | 39009 | 38454 | 39564 |
library(ggplot2)
mass_med_inc |>
ggplot(aes(x = estimate, y = reorder(name, estimate))) +
geom_errorbar(aes(xmin = lower_90, xmax = upper_90)) +
geom_point(color = "red", size = 2) +
labs(title = "Household income by county in Massachusetts",
subtitle = "2017-2021 American Community Survey",
y = "",
x = "Median Income",
caption = "ACS estimate (bars represent 90% confidence intervals)") +
theme_minimal()
15:00
reactable
reactable
is an R package that lets you create interactive tables