# NOT RUN {
library(eechidna)
nat_map19 <- nat_map_download(2019)
# choropleth map with Australian Census data
nat_map19$region <- nat_map19$elect_div
data(abs2019)
abs2019$region <- abs2019$DivisionNm
library(ggplot2)
library(ggthemes)
both <- intersect(unique(abs2019$region), unique(nat_map19$region))
ggplot(aes(map_id=region), data=subset(abs2019, region %in% both)) +
geom_map(aes(fill=MedianPersonalIncome), map=subset(nat_map19, region %in% both)) +
expand_limits(x=nat_map19$long, y=nat_map19$lat) +
theme_map()
# }
Run the code above in your browser using DataLab