if (FALSE) { # rlang::is_installed(c("maps", "ggplot2"))
# load libraries for models and data
library(maps)
library(ggplot2)
ca <- map("county", "ca", plot = FALSE, fill = TRUE)
tidy(ca)
qplot(long, lat, data = ca, geom = "polygon", group = group)
tx <- map("county", "texas", plot = FALSE, fill = TRUE)
tidy(tx)
qplot(long, lat,
data = tx, geom = "polygon", group = group,
colour = I("white")
)
}
Run the code above in your browser using DataLab