Showing preview only (248K chars total). Download the full file or copy to clipboard to get everything.
Repository: UrbanInstitute/urbnmapr
Branch: master
Commit: ef9f4488d6bc
Files: 80
Total size: 230.0 KB
Directory structure:
gitextract_haf2t6ds/
├── .Rbuildignore
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── DESCRIPTION
├── NAMESPACE
├── NEWS.md
├── R/
│ ├── ccdf_labels.R
│ ├── counties.R
│ ├── counties_labels.R
│ ├── countydata.R
│ ├── get_urbn_labels.R
│ ├── get_urbn_map.R
│ ├── statedata.R
│ ├── states.R
│ ├── states_labels.R
│ ├── sysdata.rda
│ ├── territories_counties.R
│ └── territories_labels.R
├── README.Rmd
├── README.md
├── data/
│ ├── counties.rda
│ ├── countydata.rda
│ ├── statedata.rda
│ └── states.rda
├── data-raw/
│ ├── ccdf.R
│ ├── ccdf_labels.R
│ ├── counties.R
│ ├── counties_labels.R
│ ├── counties_sf.R
│ ├── countydata.R
│ ├── generate_sysdata.R
│ ├── statedata.R
│ ├── states.R
│ ├── states_labels.R
│ ├── states_sf.R
│ ├── territories.R
│ ├── territories_counties.R
│ ├── territories_counties_sf.R
│ ├── territories_labels.R
│ ├── territories_sf.R
│ └── utils.R
├── docs/
│ ├── CODE_OF_CONDUCT.html
│ ├── articles/
│ │ ├── index.html
│ │ ├── introducing-urbnmapr.html
│ │ └── start-to-finish.html
│ ├── authors.html
│ ├── docsearch.css
│ ├── docsearch.js
│ ├── index.html
│ ├── news/
│ │ └── index.html
│ ├── pkgdown.css
│ ├── pkgdown.js
│ ├── pkgdown.yml
│ └── reference/
│ ├── ccdf_labels.html
│ ├── counties.html
│ ├── counties_labels.html
│ ├── countydata.html
│ ├── get_urbn_labels.html
│ ├── get_urbn_map.html
│ ├── index.html
│ ├── statedata.html
│ ├── states.html
│ ├── states_labels.html
│ ├── territories_counties.html
│ └── territories_labels.html
├── hexsticker.R
├── man/
│ ├── ccdf_labels.Rd
│ ├── counties.Rd
│ ├── counties_labels.Rd
│ ├── countydata.Rd
│ ├── get_urbn_labels.Rd
│ ├── get_urbn_map.Rd
│ ├── statedata.Rd
│ ├── states.Rd
│ ├── states_labels.Rd
│ ├── territories_counties.Rd
│ └── territories_labels.Rd
├── urbnmapr.Rproj
└── vignettes/
└── introducing-urbnmapr.Rmd
================================================
FILE CONTENTS
================================================
================================================
FILE: .Rbuildignore
================================================
^.*\.Rproj$
^\.Rproj\.user$
^data-raw$
^README\.Rmd$
^README-.*\.png$
^README_files$
^\.travis\.yml$
^docs$
^CODE_OF_CONDUCT.md
^hexsticker.R
^/figures/hexsticker.png
================================================
FILE: .gitignore
================================================
.Rproj.user
.Rhistory
.RData
.Ruserdata
inst/doc
================================================
FILE: .travis.yml
================================================
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
language: R
sudo: true
dist: xenial
cache: packages
r_github_packages:
- UrbanInstitute/urbnthemes
addons:
apt:
packages:
- libudunits2-dev
- libgdal-dev
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html
================================================
FILE: DESCRIPTION
================================================
Package: urbnmapr
Type: Package
Title: State and county shapefiles in sf and tibble format
Version: 0.0.0.9002
Authors@R: c(
person('Sarah', 'Strochak', email = 'sstrochak@urban.org', role = c('aut', 'cre')),
person('Kyle', 'Ueyama', email = 'kueyama@urban.org', role = 'aut'),
person('Aaron', 'Williams', email = 'awilliams@urban.org', role = 'aut'),
person(family = 'Urban Institute', role = 'cph'),
person('William', 'Murphy', role = c('ctb', 'cph'), comment = 'Original author for copied and derived code for fiftystater'),
person('Barry', 'Rowlingson', role = 'ctb', comment = 'Original author for copied and derived code for fiftystater')
)
Description: Provides state and county shapefiles in 'sf' and 'tibble' format that is
compatible to map with 'ggplot2'. Shapefiles include Alaska and Hawaii,
transformed to be displayed as insets within the continental United States.
Heavily inspired by and derived in part from the fiftystater
package <https://cran.r-project.org/package=fiftystater> by William Murphy.
Depends:
R (>= 3.4.0)
Imports:
tibble,
mapproj,
sf
Suggests:
tidyverse,
urbnthemes,
scales,
knitr,
rmarkdown
URL: https://github.com/UrbanInstitute/urbnmapr
BugReports: https://github.com/UrbanInstitute/urbnmapr/issues
LazyData: true
License: GPL-3
Encoding: UTF-8
RoxygenNote: 6.1.1
VignetteBuilder: knitr
================================================
FILE: NAMESPACE
================================================
# Generated by roxygen2: do not edit by hand
export(get_urbn_labels)
export(get_urbn_map)
importFrom(tibble,tibble)
================================================
FILE: NEWS.md
================================================
## urbnmapr 0.0.0.9002
* Adds `SF` option to `get_urbn_map()` and `get_urbn_label()`
* Add [pkgdown](https://github.com/r-lib/pkgdown) website [here](https://urbaninstitute.github.io/urbnmapr/)
## urbnmapr 0.0.0.9001
Two functions have been added to the package, with two additional shape
options:
* `get_urbn_map` will return the requested shapefile, parsed into a `tibble`
* `get_urbn_labels` will return a `tibble` of coordinates and map labels
The valid options for each are:
1. states
2. counties
3. ccdf
4. territories
5. territories_counties
## urbnmapr 0.0.0.9000
This is the initial release of the `urbnmapr` package. It includes state and
county-level shapefiles parsed into a `tibble` for easy plotting with
`ggplot2`.
================================================
FILE: R/ccdf_labels.R
================================================
#' Child Care and Development Fund labels data
#'
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{state_name, state_abbv}{State name and state abbreviation}
#' }
'ccdf_labels'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/counties.R
================================================
#' County shapefile data
#'
#' County shapefile data, cleaned and parsed into a tibble for easy mapping.
#' Includes various state identifiers for easy merging.
#'
#' @source United States Census Bureau,
#' \url{https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html}
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{county_name, county_fips, fips_class}{County name, five-digit FIPS and FIPS class code}
#' \item{state_name, state_abbv, state_fips}{State name, postal abbreviation, and two-digit FIPS code}
#' }
'counties'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/counties_labels.R
================================================
#' County labels data
#'
#' Includes various state identifiers for easy merging.
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{county_name, county_fips, fips_class}{County name, five-digit FIPS and FIPS class code}
#' \item{state_name, state_abbv, state_fips}{State name, postal abbreviation, and two-digit FIPS code}
#' }
'counties_labels'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/countydata.R
================================================
#' County data for mapping
#'
#' County-level data to use for example maps.
#' Includes county FIPS code to match with county shapefile data.
#'
#' @source Urban Institute Sloan ADRF Database,
#' \url{https://adrf.urban.org}
#'
#' @format Data frame with columns
#' \describe{
#' \item{year}{Year of data}
#' \item{county_fips}{Five-digit FIPS code}
#' \item{hhhpop}{Household population}
#' \item{horate}{Homeownership rate}
#' \item{medhhincome}{Median household income}
#' }
'countydata'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/get_urbn_labels.R
================================================
#' Import different map labels.
#'
#' `get_urbn_labels()` loads labels and coordinates for maps from the `get_urbn_map()` functions.
#' Note: there are currently only `sf` options for `states` and `territories_states`, as
#' these are the only options that have custom labels. To label `counties` and `territories_counties`,
#' use `geom_sf_text()` or `geom_sf_label()`.
#'
#' @param map Selection of custom labels. Current options are `"states"`, `"counties"`, `"ccdf"`, `"territories"`, and `"territories_counties"`.
#' @param sf Option indicates whether data is loaded as a `tibble()` or an `sf` object
#'
#' @md
#' @export
get_urbn_labels <- function(map = "states", sf = FALSE) {
if (sf == FALSE) {
if (map == "states") {
states_labels
} else if (map == "counties") {
counties_labels
} else if (map == "ccdf") {
ccdf_labels
} else if (map == "territories") {
rbind(states_labels, territories_labels[, c("state_name", "lat", "long", "state_abbv")])
} else if (map == "territories_counties") {
rbind(counties_labels, territories_labels[, !(names(territories_labels) %in% "state_abbv")])
} else {
stop("Invalid 'map' argument. Valid maps are: ",
"states, counties, ccdf, territories_states, territories_counties.",
call. = FALSE
)
}
} else if (sf == TRUE) {
if (map == "states") {
states_labels_sf
} else if (map == "territories_states") {
rbind(states_labels_sf, territories_labels_sf)
} else {
stop("SF option is only available for states and territories_states maps",
call. = FALSE
)
}
}
}
================================================
FILE: R/get_urbn_map.R
================================================
#' Import different maps
#'
#' `get_urbn_map()` loads maps that are different than `states` and `counties`
#'
#' @param map Selection of custom map. Current options are `"states"`, `"counties"`, `"ccdf"`, `"territories_states"`, and `"territories_counties"`.
#' @param sf Option indicates whether data is loaded as a `tibble()` or an `sf` object
#'
#' @md
#' @export
get_urbn_map <- function(map = "states", sf = FALSE) {
if (sf == FALSE) {
if (map == "states") {
urbnmapr::states
} else if (map == "counties") {
urbnmapr::counties
} else if (map == "ccdf") {
rbind(
urbnmapr::states[!urbnmapr::states$state_name %in%
c("Alaska", "Hawaii", "District of Columbia"), ],
ccdf
)
} else if (map == "territories_states") {
rbind(
urbnmapr::states[!urbnmapr::states$state_name %in%
c("Alaska", "Hawaii"), ],
territories
)
} else if (map == "territories_counties") {
rbind(
urbnmapr::counties[!urbnmapr::counties$state_name %in%
c("Alaska", "Hawaii"), ],
territories_counties
)
} else {
stop("Invalid 'map' argument. Valid maps are: ",
"states, counties, ccdf, territories_states, and territories_counties.",
call. = FALSE
)
}
} else if (sf == TRUE) {
if (map == "states") {
sf::st_as_sf(states_sf)
} else if (map == "counties") {
sf::st_as_sf(counties_sf)
} else if (map == "ccdf") {
stop("SF option not available for CCDF map")
} else if (map == "territories_states") {
sf::st_as_sf(rbind(
states_sf[!states_sf$state_name %in%
c("Alaska", "Hawaii"), ],
territories_sf
))
} else if (map == "territories_counties") {
sf::st_as_sf(rbind(
counties_sf[!counties_sf$state_name %in%
c("Alaska", "Hawaii"), ],
territories_counties_sf
))
} else {
stop("Invalid 'map' argument. Valid maps are: ",
"states, counties, ccdf, territories_states, and territories_counties.",
call. = FALSE
)
}
}
}
================================================
FILE: R/statedata.R
================================================
#' State data for mapping
#'
#' State-level data to use for example maps.
#' Includes state FIPS code to match with state shapefile data.
#'
#' @source Urban Institute Sloan ADRF Database,
#' \url{https://adrf.urban.org}
#'
#' @format Data frame with columns
#' \describe{
#' \item{year}{Year of data}
#' \item{state_fips, state_name}{Two-digit FIPS code and state name}
#' \item{hhhpop}{Household population}
#' \item{horate}{Homeownership rate}
#' \item{medhhincome}{Median household income}
#' }
'statedata'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/states.R
================================================
#' State shapefile data
#'
#' State shapefile data, cleaned and parsed into a tibble for easy mapping.
#' Includes various state identifiers for easy merging.
#'
#' @source United States Census Bureau,
#' \url{https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html}
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{state_name, state_abbv, state_fips}{State name, postal abbreviation, and two-digit FIPS code}
#' }
'states'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/states_labels.R
================================================
#' States labels data
#'
#' States labels data
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{state_name, state_abbv}{State name and state abbreviation}
#' }
'states_labels'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/territories_counties.R
================================================
#' County shapefile data with U.S. territories
#'
#' County shapefile data with territories, cleaned and parsed into a tibble
#' for easy mapping. Includes various state identifiers for easy merging.
#'
#' @source United States Census Bureau,
#' \url{https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html}
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{county_name, county_fips, fips_class}{County name, five-digit FIPS and FIPS class code}
#' \item{state_name, state_abbv, state_fips}{State name, postal abbreviation, and two-digit FIPS code}
#' }
'territories_counties'
#' @importFrom tibble tibble
NULL
================================================
FILE: R/territories_labels.R
================================================
#' Territories labels data
#'
#' Territories labels data
#'
#' @format Data frame with columns
#' \describe{
#' \item{long, lat}{Longitude and latitude}
#' \item{state_name, state_abbv}{State name and state abbreviation}
#' }
'territories_labels'
#' @importFrom tibble tibble
NULL
================================================
FILE: README.Rmd
================================================
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# urbnmapr <a href="https://urbaninstitute.github.io/urbnmapr/"><img src="man/figures/hexsticker.png" align="right" height="160"/></a>
[](https://travis-ci.org/UrbanInstitute/urbnmapr)
The `urbnmapr` package provides state and county shapefiles that are compatible to map with `ggplot2`.
Shapefiles include Alaska and Hawaii, transformed to be displayed as insets within the continental United States. There are options to include the territories for both the state and county maps.
This package is heavily inspired by and derived in part from the [fiftystater package](https://cran.r-project.org/package=fiftystater) by William Murphy. In contrast, `urbnmapr`:
- Uses shapefiles from the US Census Bureau
- Converts the shapefile data to `sf` format
- Adds various identifiers for merging
- Includes a county-level shapefile and options to add territories
## Stay up-to-date
Sign up [here](https://app.smartsheet.com/b/form/9029a0a8254e4044a52cdebaebe343bf) to stay up-to-date with R package releases and R resources from the Urban Institute. We will not share your information and we will not email more than once per month.
## Installation
You can install the latest version of `urbnmapr` from GitHub:
```{r installation, message=FALSE, warning=FALSE, eval=FALSE}
# install.packages("devtools")
devtools::install_github("UrbanInstitute/urbnmapr")
```
## Usage
### Quick maps
The `get_urbn_map()` function can be used to call shapefiles. Using the `sf = TRUE` option will load `sf` objects. These can be used with `geom_sf()` to create base maps of the continental United States, with Alaska and Hawaii displayed as insets:
```{r sf-state, message=FALSE, warning=FALSE}
library(tidyverse)
library(urbnmapr)
states_sf <- get_urbn_map("states", sf = TRUE)
states_sf %>%
ggplot(aes()) +
geom_sf(fill = "grey", color = "#ffffff")
```
```{r sf-county, message=FALSE, warning=FALSE}
library(tidyverse)
library(urbnmapr)
counties_sf <- get_urbn_map("counties", sf = TRUE)
counties_sf %>%
ggplot(aes()) +
geom_sf(fill = "grey", color = "#ffffff")
```
The default projection is US National Atlas Equal Area.
### More maps
Maps with US territories can also be called with `get_urbn_map()`.
```{r terr}
territories_counties <- get_urbn_map(map = "territories_counties", sf = TRUE)
ggplot() +
geom_sf(territories_counties,
mapping = aes(),
fill = "grey", color = "#ffffff")
```
### Labels
Labels for states maps can be accessed with `get_urbn_labels()`. Only state labels are custom, so they can be displayed next to smaller states. Use the function to call the appropriate labels and then label the map with `geom_sf_text()`.
```{r quick-labels}
states_sf <- get_urbn_map(map = "states", sf = TRUE)
states_sf %>%
ggplot() +
geom_sf(aes(),
fill = "grey", color = "#ffffff", size = 0.25) +
geom_sf_text(data = get_urbn_labels(map = "states", sf = TRUE),
aes(label = state_abbv),
size = 3)
```
## Merging Data
The states and counties spatial data include various identifiers to simplify merging data. The states `states` tibble contains `state_fips`, `state_abbv`, and `state_name`. The `counties` tibble contains `county_fips`, `state_abbv`, `state_fips`, `county_name`, and `state_name`.
Continuous data can be mapping on a color scale.
```{r us-choropleth}
spatial_data <- left_join(get_urbn_map(map = "states", sf = TRUE),
statedata,
by = "state_name")
ggplot() +
geom_sf(spatial_data,
mapping = aes(fill = horate),
color = "#ffffff", size = 0.25) +
labs(fill = "Homeownership rate")
```
Categorical data can be mapped on a discrete color scale.
```{r county}
counties_sf <- get_urbn_map(map = "counties", sf = TRUE)
county_groups <- countydata %>%
mutate(cat_var = paste0("Group ",
sample(1:4, nrow(countydata), replace = TRUE)))
household_data <- left_join(counties_sf, county_groups, by = "county_fips")
household_data %>%
ggplot() +
geom_sf(mapping = aes(fill = cat_var),
color = NA, size = 0.05) +
labs(fill = "Categorical variable")
```
## Styles
`library(urbnmapr)` works well with [`library(urbnthemes)](https://github.com/UrbanInstitute/urbnthemes)
```{r load-theme, message=FALSE}
library(urbnthemes)
set_urbn_defaults(style = "map")
```
```{r theme-state}
states_sf <- get_urbn_map(map = "states", sf = TRUE)
states_sf %>%
left_join(statedata, by = "state_name") %>%
ggplot() +
geom_sf(mapping = aes(fill = horate),
color = "#ffffff", size = 0.25) +
scale_fill_gradientn(labels = scales::percent) +
labs(fill = "Homeownership rate") +
coord_sf(datum = NA)
```
Map smaller geographies with `filter()`. You may need to reproject the data based on which areas you are mapping.
```{r theme-counties}
household_data %>%
filter(state_name == "California") %>%
ggplot() +
geom_sf(mapping = aes(fill = medhhincome),
color = "#ffffff", size = 0.05) +
coord_sf(datum = NA) +
scale_fill_gradientn(labels = scales::dollar) +
labs(fill = "Median household income")
```
A discrete color scale can also be used for categorical data.
```{r state-discrete}
state_categorical <- left_join(get_urbn_map(map = "states", sf = TRUE),
statedata,
by = "state_name") %>%
mutate(cat_var = paste0("Group ",
sample(1:4, nrow(statedata), replace = TRUE)))
ggplot() +
geom_sf(state_categorical, mapping = aes(fill = cat_var),
color = "#ffffff") +
scale_fill_discrete() +
coord_sf(datum = NA) +
labs(fill = "Categorical variable")
```
## License
Code released under the GNU General Public License v3.0.
## Code of conduct
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
================================================
FILE: README.md
================================================
<!-- README.md is generated from README.Rmd. Please edit that file -->
# urbnmapr <a href="https://urbaninstitute.github.io/urbnmapr/"><img src="man/figures/hexsticker.png" align="right" height="160"/></a>
[](https://travis-ci.org/UrbanInstitute/urbnmapr)
The `urbnmapr` package provides state and county shapefiles that are
compatible to map with `ggplot2`.
Shapefiles include Alaska and Hawaii, transformed to be displayed as
insets within the continental United States. There are options to
include the territories for both the state and county maps.
This package is heavily inspired by and derived in part from the
[fiftystater package](https://cran.r-project.org/package=fiftystater) by
William Murphy. In contrast, `urbnmapr`:
- Uses shapefiles from the US Census Bureau
- Converts the shapefile data to `sf` format
- Adds various identifiers for merging
- Includes a county-level shapefile and options to add territories
## Stay up-to-date
Sign up
[here](https://app.smartsheet.com/b/form/9029a0a8254e4044a52cdebaebe343bf)
to stay up-to-date with R package releases and R resources from the
Urban Institute. We will not share your information and we will not
email more than once per month.
## Installation
You can install the latest version of `urbnmapr` from GitHub:
``` r
# install.packages("devtools")
devtools::install_github("UrbanInstitute/urbnmapr")
```
## Usage
### Quick maps
The `get_urbn_map()` function can be used to call shapefiles. Using the
`sf = TRUE` option will load `sf` objects. These can be used with
`geom_sf()` to create base maps of the continental United States, with
Alaska and Hawaii displayed as insets:
``` r
library(tidyverse)
library(urbnmapr)
states_sf <- get_urbn_map("states", sf = TRUE)
states_sf %>%
ggplot(aes()) +
geom_sf(fill = "grey", color = "#ffffff")
```
<!-- -->
``` r
library(tidyverse)
library(urbnmapr)
counties_sf <- get_urbn_map("counties", sf = TRUE)
counties_sf %>%
ggplot(aes()) +
geom_sf(fill = "grey", color = "#ffffff")
```
<!-- -->
The default projection is US National Atlas Equal Area.
### More maps
Maps with US territories can also be called with
`get_urbn_map()`.
``` r
territories_counties <- get_urbn_map(map = "territories_counties", sf = TRUE)
ggplot() +
geom_sf(territories_counties,
mapping = aes(),
fill = "grey", color = "#ffffff")
```
<!-- -->
### Labels
Labels for states maps can be accessed with `get_urbn_labels()`. Only
state labels are custom, so they can be displayed next to smaller
states. Use the function to call the appropriate labels and then label
the map with `geom_sf_text()`.
``` r
states_sf <- get_urbn_map(map = "states", sf = TRUE)
states_sf %>%
ggplot() +
geom_sf(aes(),
fill = "grey", color = "#ffffff", size = 0.25) +
geom_sf_text(data = get_urbn_labels(map = "states", sf = TRUE),
aes(label = state_abbv),
size = 3)
```
<!-- -->
## Merging Data
The states and counties spatial data include various identifiers to
simplify merging data. The states `states` tibble contains `state_fips`,
`state_abbv`, and `state_name`. The `counties` tibble contains
`county_fips`, `state_abbv`, `state_fips`, `county_name`, and
`state_name`.
Continuous data can be mapping on a color scale.
``` r
spatial_data <- left_join(get_urbn_map(map = "states", sf = TRUE),
statedata,
by = "state_name")
ggplot() +
geom_sf(spatial_data,
mapping = aes(fill = horate),
color = "#ffffff", size = 0.25) +
labs(fill = "Homeownership rate")
```
<!-- -->
Categorical data can be mapped on a discrete color scale.
``` r
counties_sf <- get_urbn_map(map = "counties", sf = TRUE)
county_groups <- countydata %>%
mutate(cat_var = paste0("Group ",
sample(1:4, nrow(countydata), replace = TRUE)))
household_data <- left_join(counties_sf, county_groups, by = "county_fips")
household_data %>%
ggplot() +
geom_sf(mapping = aes(fill = cat_var),
color = NA, size = 0.05) +
labs(fill = "Categorical variable")
```
<!-- -->
## Styles
`library(urbnmapr)` works well with
[\`library(urbnthemes)](https://github.com/UrbanInstitute/urbnthemes)
``` r
library(urbnthemes)
set_urbn_defaults(style = "map")
```
## Warning: New theme missing the following elements: axis.ticks.length.x,
## axis.ticks.length.x.top, axis.ticks.length.x.bottom, axis.ticks.length.y,
## axis.ticks.length.y.left, axis.ticks.length.y.right
``` r
states_sf <- get_urbn_map(map = "states", sf = TRUE)
states_sf %>%
left_join(statedata, by = "state_name") %>%
ggplot() +
geom_sf(mapping = aes(fill = horate),
color = "#ffffff", size = 0.25) +
scale_fill_gradientn(labels = scales::percent) +
labs(fill = "Homeownership rate") +
coord_sf(datum = NA)
```
<!-- -->
Map smaller geographies with `filter()`. You may need to reproject the
data based on which areas you are mapping.
``` r
household_data %>%
filter(state_name == "California") %>%
ggplot() +
geom_sf(mapping = aes(fill = medhhincome),
color = "#ffffff", size = 0.05) +
coord_sf(datum = NA) +
scale_fill_gradientn(labels = scales::dollar) +
labs(fill = "Median household income")
```
<!-- -->
A discrete color scale can also be used for categorical data.
``` r
state_categorical <- left_join(get_urbn_map(map = "states", sf = TRUE),
statedata,
by = "state_name") %>%
mutate(cat_var = paste0("Group ",
sample(1:4, nrow(statedata), replace = TRUE)))
ggplot() +
geom_sf(state_categorical, mapping = aes(fill = cat_var),
color = "#ffffff") +
scale_fill_discrete() +
coord_sf(datum = NA) +
labs(fill = "Categorical variable")
```
<!-- -->
## License
Code released under the GNU General Public License v3.0.
## Code of conduct
Please note that this project is released with a [Contributor Code of
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree
to abide by its terms.
================================================
FILE: data-raw/ccdf.R
================================================
# American Samoa needs multiple transformations. The transformation are simpler
# with the county data. get American Samoa, tidy, add fips data, and remove
# county data
american_samoa <- get_ccdf_shapefile(2016, "county", "5m") %>%
filter(state_name == "American Samoa")
# get state shapefile, tidy, add fips data
ccdf <- get_ccdf_shapefile(2016, "state", "5m") %>%
filter(state_fips %in% c("02", "11", "15", "52", "66", "69", "72", "78")) %>%
mutate(group = as.character(group),
piece = as.character(piece))
ccdf <- bind_rows(ccdf, american_samoa)
================================================
FILE: data-raw/ccdf_labels.R
================================================
# labels for ccdf map
# to be called only by generate_sysdata.R for internal package use
ccdf_labels <- readr::read_csv(
"state_name, lat, long, state_abbv
Alabama, 32.7794, -86.8287, AL
Alaska, 45.5, -133, AK
American Samoa, 31.2, -127, AS
Arizona, 34.2744, -111.6602, AZ
Arkansas, 34.8938, -92.4426, AR
California, 37.1841, -119.4696, CA
Colorado, 38.9972, -105.5478, CO
Connecticut, 41, -71.5, CT
Delaware, 39, -73.6, DE
District of Columbia, 36.7, -73.2, DC
Florida, 28.6305, -81.6, FL
Georgia, 32.6415, -83.4426, GA
Guam, 36.6, -129, GU
Hawaii, 35, -125.5, HI
Idaho, 44.3509, -115, ID
Illinois, 40.0417, -89.1965, IL
Indiana, 39.8942, -86.2816, IN
Iowa, 42.0751, -93.4960, IA
Kansas, 38.4937, -98.3804, KS
Kentucky, 37.5347, -85.3021, KY
Louisiana, 31.5, -92.7, LA
Maine, 45.3695, -69.2428, ME
Mariana Islands, 35, -133, MP
Maryland, 38, -74, MD
Massachusetts, 42.2596, -69, MA
Michigan, 43, -84.5, MI
Minnesota, 46.2807, -94.3053, MN
Mississippi, 32.7364, -89.6678, MS
Missouri, 38.3566, -92.4580, MO
Montana, 47.0527, -109.6333, MT
Nebraska, 41.5378, -99.7951, NE
Nevada, 39.3289, -116.6312, NV
New Hampshire, 45.8, -71.7, NH
New Jersey, 40.1907, -73, NJ
New Mexico, 34.4071, -106.1126, NM
New York, 42.9538, -75, NY
North Carolina, 35.5557, -79.3877, NC
North Dakota, 47.4501, -100.4659, ND
Ohio, 40.2862, -82.7937, OH
Oklahoma, 35.5889, -97.4943, OK
Oregon, 43.9336, -120.5583, OR
Pennsylvania, 40.8781, -77.7996, PA
Puerto Rico, 31, -74.5, PR
Rhode Island, 41, -69.8, RI
South Carolina, 33.9169, -80.8964, SC
South Dakota, 44.4443, -100.2263, SD
Tennessee, 35.8580, -86.3505, TN
Texas, 31.4757, -99.3312, TX
Utah, 39.3055, -111.6703, UT
Vermont, 45.5, -74, VT
Virgin Islands, 27.3, -75.5, VI
Virginia, 37.6, -78.3, VA
Washington, 47.3826, -120, WA
West Virginia, 38.6409, -80.6227, WV
Wisconsin, 44.6243, -89.9941, WI
Wyoming, 42.9957, -107.5512, WY")
================================================
FILE: data-raw/counties.R
================================================
# load utility functions
source('data-raw/utils.R')
# get state shapefile, tidy, add fips data
counties <- get_shapefile(2016, 'county', '5m') %>%
tidy(region = "GEOID") %>%
rename(county_fips = id) %>%
as_tibble() %>%
left_join(get_county_fips(), by = "county_fips") %>%
filter(!state_fips %in% c("60", "66", "69", "72", "78"))
# compress and save
save(counties, file = 'data/counties.rda', compress = 'bzip2')
================================================
FILE: data-raw/counties_labels.R
================================================
# generate counties labels
# to be called only by generate_sysdata.R for internal package use
library(dplyr)
counties_labels <- urbnmapr::counties %>%
group_by(county_name, state_name, county_fips, state_fips, fips_class) %>%
summarize(lat = mean(lat), long = mean(long)) %>%
ungroup()
================================================
FILE: data-raw/counties_sf.R
================================================
# get county shapefile, convert to SF, add fips data, filter out territories
counties_sf <- get_shapefile(2016, 'county', '5m') %>%
sf::st_as_sf() %>%
# set prejection to US National Atlas Equal Area
sf::st_transform(crs = 2163) %>%
mutate(county_fips = paste0(STATEFP, COUNTYFP)) %>%
select(county_fips) %>%
left_join(get_county_fips(), by = "county_fips") %>%
filter(!state_fips %in% c("60", "66", "69", "72", "78"))
================================================
FILE: data-raw/countydata.R
================================================
library(tidyverse)
# read county level household variables from Sloan database
temp <- tempfile(fileext = '.zip')
download.file('https://s3.amazonaws.com/ui-spark-social-science-public/sloan-hfpc-data/county_household_csv.zip', temp)
temp_dir <- tempdir()
unzip(temp, exdir = temp_dir, junkpaths = TRUE)
countydata <- read_csv(paste(temp_dir, 'county_household.csv', sep='/'),
guess_max = 40000)
countydata <- countydata %>%
# recode county changes - see https://www.census.gov/geo/reference/county-changes.html
# Shannon County, SD changed name to Oglala Lakota County effective May 1, 2015
mutate(county = if_else(county == '46113', '46102', county)) %>%
# Wade Hampton Census Area, AK changed name and code to Kusilvak Census Area effective July 1, 2015
mutate(county = if_else(county == '02270', '02158', county)) %>%
filter(YEAR == 2015) %>%
mutate(hhpop = OWNERSHP_1 + OWNERSHP_2,
horate = OWNERSHP_1 / hhpop) %>%
select(year = YEAR, county_fips = county,
hhpop, horate,
medhhincome = HHINCOME_P50)
save(countydata, file = 'data/countydata.rda', compress = 'bzip2')
================================================
FILE: data-raw/generate_sysdata.R
================================================
# source & save various data creation files for internal sysdata.rda
source('data-raw/utils.R')
source('data-raw/states_labels.R')
source('data-raw/counties_labels.R')
source('data-raw/ccdf_labels.R')
source('data-raw/territories_labels.R')
source('data-raw/territories_counties.R')
source('data-raw/territories.R')
source('data-raw/ccdf.R')
# sf data
source('data-raw/counties_sf.R')
source('data-raw/territories_counties_sf.R')
source('data-raw/states_sf.R')
source('data-raw/territories_sf.R')
save(states_labels,
states_labels_sf,
counties_labels,
ccdf_labels,
territories_labels,
territories_labels_sf,
territories_counties,
territories,
ccdf,
counties_sf,
territories_counties_sf,
states_sf,
territories_sf,
file = 'R/sysdata.rda',
compress = 'bzip2')
================================================
FILE: data-raw/statedata.R
================================================
library(tidyverse)
# read county level household variables from Sloan database
temp <- tempfile(fileext = '.zip')
download.file('https://s3.amazonaws.com/ui-spark-social-science-public/sloan-hfpc-data/state_household_csv.zip', temp)
temp_dir <- tempdir()
unzip(temp, exdir = temp_dir, junkpaths = TRUE)
statedata <- read_csv(paste(temp_dir, 'state_household.csv', sep='/'),
guess_max = 40000)
statedata <- statedata %>%
filter(YEAR == 2015) %>%
# create accurate state FIPS code variable
mutate(state_fips = ifelse(str_length(state) == 1, paste0("0", state), state)) %>%
mutate(hhpop = OWNERSHP_1 + OWNERSHP_2,
horate = OWNERSHP_1 / hhpop) %>%
select(year = YEAR, state_fips, state_name = STATENAME,
hhpop, horate,
medhhincome = HHINCOME_P50)
save(statedata, file = 'data/statedata.rda', compress = 'bzip2')
================================================
FILE: data-raw/states.R
================================================
# load utility functions
source('data-raw/utils.R')
# get state shapefile, tidy, add fips data
states <- get_shapefile(2016, 'state', '5m') %>%
tidy(region = "STATEFP") %>%
rename(state_fips = id) %>%
as_tibble() %>%
left_join(get_state_fips(), by = "state_fips") %>%
filter(!state_fips %in% c("66", "69", "72", "78", "60"))
# compress and save
save(states, file = 'data/states.rda', compress = 'bzip2')
================================================
FILE: data-raw/states_labels.R
================================================
# states labels
# to be called only by generate_sysdata.R for internal package use
states_labels <- readr::read_csv(
"state_name, lat, long, state_abbv
Alabama, 32.7794, -86.8287, AL
Alaska, 27.3, -116.5, AK
Arizona, 34.2744, -111.6602, AZ
Arkansas, 34.8938, -92.4426, AR
California, 37.1841, -119.4696, CA
Colorado, 38.9972, -105.5478, CO
Connecticut, 41, -71.7, CT
Delaware, 39, -73.6, DE
District of Columbia, 39, -78, DC
Florida, 28.6305, -81.6, FL
Georgia, 32.6415, -83.4426, GA
Hawaii, 26, -107, HI
Idaho, 44.3509, -115, ID
Illinois, 40.0417, -89.1965, IL
Indiana, 39.8942, -86.2816, IN
Iowa, 42.0751, -93.4960, IA
Kansas, 38.4937, -98.3804, KS
Kentucky, 37.5347, -85.3021, KY
Louisiana, 31.5, -92.7, LA
Maine, 45.3695, -69.2428, ME
Maryland, 38, -74, MD
Massachusetts, 42.2596, -69, MA
Michigan, 43, -84.5, MI
Minnesota, 46.2807, -94.3053, MN
Mississippi, 32.7364, -89.6678, MS
Missouri, 38.3566, -92.4580, MO
Montana, 47.0527, -109.6333, MT
Nebraska, 41.5378, -99.7951, NE
Nevada, 39.3289, -116.6312, NV
New Hampshire, 45.8, -71.7, NH
New Jersey, 40.1907, -73, NJ
New Mexico, 34.4071, -106.1126, NM
New York, 42.9538, -75, NY
North Carolina, 35.5557, -79.3877, NC
North Dakota, 47.4501, -100.4659, ND
Ohio, 40.2862, -82.7937, OH
Oklahoma, 35.5889, -97.4943, OK
Oregon, 43.9336, -120.5583, OR
Pennsylvania, 40.8781, -77.7996, PA
Rhode Island, 41, -69.6, RI
South Carolina, 33.9169, -80.8964, SC
South Dakota, 44.4443, -100.2263, SD
Tennessee, 35.8580, -86.3505, TN
Texas, 31.4757, -99.3312, TX
Utah, 39.3055, -111.6703, UT
Vermont, 45.5, -74, VT
Virginia, 37.6, -78.3, VA
Washington, 47.3826, -120, WA
West Virginia, 38.6409, -80.6227, WV
Wisconsin, 44.6243, -89.9941, WI
Wyoming, 42.9957, -107.5512, WY")
# create identical SF version
states_labels_sf <- states_labels %>%
# convert to SF
sf::st_as_sf(coords = c("long", "lat")) %>%
# set CRS
sf::st_set_crs(4326) %>%
# transform CRS
sf::st_transform(crs = 2163) %>%
# add FIPS codes
left_join(get_state_fips(), by = c("state_name", "state_abbv"))
================================================
FILE: data-raw/states_sf.R
================================================
# get state shapefile, convert to SF, add fips data
states_sf <- get_shapefile(2016, 'state', '5m') %>%
sf::st_as_sf() %>%
# set prejection to US National Atlas Equal Area
sf::st_transform(crs = 2163) %>%
select(state_fips = STATEFP) %>%
left_join(get_state_fips(), by = "state_fips") %>%
filter(!state_fips %in% c("66", "69", "72", "78", "60"))
================================================
FILE: data-raw/territories.R
================================================
# American Samoa needs multiple transformations. The transformation are simpler
# with the county data. get American Samoa, tidy, add fips data, and remove
# county data
american_samoa <- get_shapefile(2016, 'county', '5m') %>%
tidy(region = "GEOID") %>%
rename(county_fips = id) %>%
as_tibble() %>%
left_join(get_county_fips(), by = "county_fips") %>%
filter(state_name == "American Samoa") %>%
select(-county_fips, -county_name, -fips_class) %>%
mutate(group = as.character(group),
piece = as.character(piece))
# get state shapefile, tidy, add fips data
territories <- get_shapefile(2016, 'state', '5m') %>%
tidy(region = "GEOID") %>%
rename(state_fips = id) %>%
as_tibble() %>%
left_join(get_state_fips(), by = "state_fips") %>%
filter(state_fips %in% c("02", "15", "66", "69", "72", "78")) %>%
mutate(group = as.character(group),
piece = as.character(piece))
territories <- bind_rows(territories, american_samoa)
================================================
FILE: data-raw/territories_counties.R
================================================
# get state shapefile, tidy, add fips data
territories_counties <- get_shapefile(2016, 'county', '5m') %>%
tidy(region = "GEOID") %>%
rename(county_fips = id) %>%
as_tibble() %>%
left_join(get_county_fips(), by = "county_fips") %>%
filter(state_fips %in% c("02", "15", "60", "66", "69", "72", "78"))
================================================
FILE: data-raw/territories_counties_sf.R
================================================
# get county shapefile, convert to SF, add fips data
territories_counties_sf <- get_shapefile(2016, 'county', '5m') %>%
sf::st_as_sf() %>%
# set prejection to US National Atlas Equal Area
sf::st_transform(crs = 2163) %>%
mutate(county_fips = paste0(STATEFP, COUNTYFP)) %>%
select(county_fips) %>%
left_join(get_county_fips(), by = "county_fips") %>%
filter(state_fips %in% c("02", "15", "60", "66", "69", "72", "78"))
================================================
FILE: data-raw/territories_labels.R
================================================
# territories lables
# to be called only by generate_sysdata.R for internal package use
territories_labels <- readr::read_csv(
"county_name, state_name, county_fips, state_fips, fips_class, lat, long, state_abbv
American Samoa, American Samoa, NA, 60, NA, 19.5, -90, AS
Guam, Guam, NA, 66, NA, 20, -100, GU
Mariana Islands, Mariana Islands, NA, 69, NA, 22, -78.5, MP
Puerto Rico, Puerto Rico, NA, 43, NA, 21, -94, PR
Virgin Islands, Virgin Islands, NA, 78, NA, 18, -81, VI",
col_types = cols(county_name = col_character(),
state_name = col_character(),
county_fips = col_character(),
state_fips = col_character(),
fips_class = col_character(),
lat = col_double(),
long = col_double(),
state_abbv = col_character()))
territories_labels_sf <- territories_labels %>%
# convert to SF
sf::st_as_sf(coords = c("long", "lat")) %>%
# set crs to match states
sf::st_set_crs(4326) %>%
# transform CRS
sf::st_transform(crs = 2163) %>%
# get rid of county variables
select(-county_name, -fips_class, -county_fips)
================================================
FILE: data-raw/territories_sf.R
================================================
# American Samoa needs multiple transformations. The transformation are simpler
# with the county data. get American Samoa, tidy, add fips data, and remove
# county data
american_samoa_sf <- get_shapefile(2016, 'county', '5m') %>%
sf::st_as_sf() %>%
# set prejection to US National Atlas Equal Area
sf::st_transform(crs = 2163) %>%
mutate(county_fips = paste0(STATEFP, COUNTYFP)) %>%
select(county_fips) %>%
left_join(get_county_fips(), by = "county_fips") %>%
filter(state_name == "American Samoa") %>%
select(-county_fips, -county_name, -fips_class) %>%
group_by(state_name, state_abbv, state_fips) %>%
summarize() %>%
sf::st_as_sf()
# get state shapefile, tidy, add fips data
territories_sf <- get_shapefile(2016, 'state', '5m') %>%
sf::st_as_sf() %>%
# set prejection to US National Atlas Equal Area
sf::st_transform(crs = 2163) %>%
select(state_fips = STATEFP) %>%
left_join(get_state_fips(), by = "state_fips") %>%
filter(state_fips %in% c("02", "15", "66", "69", "72", "78"))
territories_sf <- rbind(territories_sf, american_samoa_sf)
================================================
FILE: data-raw/utils.R
================================================
### helper functions for parsing shapefile data --------------------------------
# load necessary libraries -----------------------------------------------------
library(dplyr)
library(readr)
library(rgeos)
library(maptools)
library(rgdal)
library(magrittr)
library(broom)
# transform AK/HI from shapefile -----------------------------------------------
# see https://github.com/wmurphyrd/fiftystater ---------------------------------
transform_state <- function(object, rot, scale, shift) {
object %>% elide(rotate = rot) %>%
elide(scale = max(apply(bbox(object), 1, diff)) / scale) %>%
elide(shift = shift)
}
# retrieve shapefile from census and apply AK/HI transformations ---------------
get_shapefile <- function(year, level, resolution) {
# set shapefile url
url_base <- 'http://www2.census.gov/geo/tiger/GENZ2016/shp/'
shape_base <- paste('cb', year, 'us', level, resolution, sep = '_')
url <- paste0(url_base, shape_base, '.zip')
# download data and unzip
temp <- tempfile(fileext = '.zip')
download.file(url, temp)
temp_dir <- tempdir()
unzip(temp, exdir = temp_dir)
# read shapefile
shapes <-
readOGR(dsn = temp_dir,
layer = shape_base,
verbose = F) %>%
spTransform(CRS("+init=epsg:2163"))
# transform AK
alaska <- shapes[shapes$STATEFP == "02", ] %>%
transform_state(-35, 2, c(-2600000, -2300000))
proj4string(alaska) <- proj4string(shapes)
# transform HI
hawaii <- shapes[shapes$STATEFP == "15", ] %>%
transform_state(-35, 0.8, c(-1170000, -2363000))
proj4string(hawaii) <- proj4string(shapes)
# transform Guam
guam <- shapes[shapes$STATEFP %in% c("66"), ] %>%
transform_state(rot = -35, scale = 0.2, shift = c(-180000, -2700000))
proj4string(guam) <- proj4string(shapes)
# transform Puerto Rico
puerto_rico <- shapes[shapes$STATEFP %in% c("72"), ] %>%
transform_state(rot = 20, scale = .5, shift = c(200000, -2500000))
proj4string(puerto_rico) <- proj4string(shapes)
# transform American Samoa
american_samoa <- shapes[shapes$STATEFP %in% c("60"), ] %>%
transform_state(rot = 0, scale = 0.1, shift = c(-1250000, -5050000))
proj4string(american_samoa) <- proj4string(shapes)
# treat islands differently
as1 <- american_samoa[!american_samoa$NAME %in% c("Rose Island", "Swains Island", "Manu'a"), ] %>%
transform_state(rot = 0, scale = 1.2, shift = c(950000, -2350000))
proj4string(as1) <- proj4string(shapes)
as2 <- american_samoa[american_samoa$NAME %in% c("Manu'a"), ] %>%
transform_state(rot = 0, scale = 1.2, shift = c(1450000, -2800000))
proj4string(as2) <- proj4string(shapes)
american_samoa <- rbind(as1, as2) %>%
# angle and size need to be slightly adjusted
transform_state(rot = 15, scale = 1, shift = c(1000000,-3000000))
proj4string(american_samoa) <- proj4string(shapes)
# transform US Virgin Islands
virgin_islands <- shapes[shapes$STATEFP %in% c("78"), ] %>%
transform_state(rot = 0, scale = 0.2, shift = c(1550000, -2700000))
proj4string(virgin_islands) <- proj4string(shapes)
# transform Mariana Islands
mariana_islands <- shapes[shapes$STATEFP %in% c("69"), ] %>%
transform_state(rot = -35, scale = 0.3, shift = c(2150000, -2450000))
proj4string(mariana_islands) <- proj4string(shapes)
# recombine shapefile
exclude <- c("02", "15", "60", "66", "69", "72", "78")
mapdata <-
shapes[!shapes$STATEFP %in% exclude, ] %>%
rbind(alaska, hawaii, guam, puerto_rico, virgin_islands,
mariana_islands, american_samoa) %>%
# convert from EPSG2163 to (US National Atlas Equal Area) WGS84
spTransform(CRS("+init=epsg:4326"))
mapdata
}
# retrieve shapefile from census and apply AK/HI transformations ---------------
get_ccdf_shapefile <- function(year, level, resolution) {
# set shapefile url
url_base <- 'http://www2.census.gov/geo/tiger/GENZ2016/shp/'
shape_base <- paste('cb', year, 'us', level, resolution, sep = '_')
url <- paste0(url_base, shape_base, '.zip')
# download data and unzip
temp <- tempfile(fileext = '.zip')
download.file(url, temp)
temp_dir <- tempdir()
unzip(temp, exdir = temp_dir)
# read shapefile
shapes <-
readOGR(dsn = temp_dir,
layer = shape_base,
verbose = F) %>%
spTransform(CRS("+init=epsg:2163"))
# transform AK
alaska <- shapes[shapes$STATEFP == "02", ] %>%
transform_state(-5, 2, c(-3500000, -200000))
proj4string(alaska) <- proj4string(shapes)
# transform HI
hawaii <- shapes[shapes$STATEFP == "15", ] %>%
transform_state(0, 0.8, c(-2500000, -1000000))
proj4string(hawaii) <- proj4string(shapes)
# transform Guam
guam <- shapes[shapes$STATEFP %in% c("66"), ] %>%
transform_state(rot = -35, scale = 0.3, shift = c(-2600000, -700000))
proj4string(guam) <- proj4string(shapes)
# transform Puerto Rico
puerto_rico <- shapes[shapes$STATEFP %in% c("72"), ] %>%
transform_state(rot = 0, scale = 1, shift = c(-1350000, 1000000))
proj4string(puerto_rico) <- proj4string(shapes)
# transform American Samoa
american_samoa <- shapes[shapes$STATEFP %in% c("60"), ] %>%
transform_state(rot = 0, scale = 0.1, shift = c(-1250000, -5050000))
proj4string(american_samoa) <- proj4string(shapes)
# treat islands differently
as1 <- american_samoa[!american_samoa$NAME %in% c("Rose Island", "Swains Island", "Manu'a"), ] %>%
transform_state(rot = 0, scale = 1.2, shift = c(200000, -2800000))
proj4string(as1) <- proj4string(shapes)
as2 <- american_samoa[american_samoa$NAME %in% c("Manu'a"), ] %>%
transform_state(rot = 0, scale = 1.2, shift = c(400000, -2800000))
proj4string(as2) <- proj4string(shapes)
american_samoa <- rbind(as1, as2) %>%
# angle and size need to be slightly adjusted
transform_state(rot = 15, scale = 1, shift = c(-2800000,-1300000))
proj4string(american_samoa) <- proj4string(shapes)
# transform US Virgin Islands
virgin_islands <- shapes[shapes$STATEFP %in% c("78"), ] %>%
transform_state(rot = 0, scale = 0.2, shift = c(2200000, -1850000))
proj4string(virgin_islands) <- proj4string(shapes)
# transform Mariana Islands
mariana_islands <- shapes[shapes$STATEFP %in% c("69"), ] %>%
transform_state(rot = -35, scale = 0.1, shift = c(-3600000, -1250000))
proj4string(mariana_islands) <- proj4string(shapes)
mariana_islands <- mariana_islands %>%
# transforms into longitude/latitude
spTransform(CRS("+init=epsg:4326")) %>% # prime meridian/equator
tidy(region = "STATEFP") %>%
as_tibble() %>%
filter(piece %in% 1:2)
# combine, transform, and tidy
ellided_areas <- c("02", "14", "15", "43", "52", "60", "66", "69", "72", "78")
fifty_states <-
shapes[!shapes$STATEFP %in% ellided_areas, ] %>%
rbind(alaska) %>%
rbind(hawaii) %>%
rbind(puerto_rico) %>%
rbind(virgin_islands) %>%
rbind(guam) %>%
rbind(american_samoa) %>%
# convert from EPSG2163 to (US National Atlas Equal Area) WGS84
spTransform(CRS("+init=epsg:4326")) %>%
tidy(region = "STATEFP") %>%
mutate(id = id) %>%
as_tibble() %>%
rbind(mariana_islands)
# star for Washington, D.C. -----------------------------------------------
star <- tribble(
~x, ~y, ~order, ~hole, ~piece, ~group, ~id,
1, 0, 1, FALSE, 1, "11", "11",
0.3, -0.2, 2, FALSE, 1, "11", "11",
0.3, -0.95, 3, FALSE, 1, "11", "11",
-0.1, -0.375, 4, FALSE, 1, "11", "11",
-0.8, -0.6, 5, FALSE, 1, "11", "11",
-0.39, 0, 6, FALSE, 1, "11", "11",
-0.8, 0.6, 7, FALSE, 1, "11", "11",
-0.1, 0.375, 8, FALSE, 1, "11", "11",
0.3, 0.95, 9, FALSE, 1, "11", "11",
0.3, 0.2, 10, FALSE, 1, "11", "11",
1, 0, 11, FALSE, 1, "11", "11"
) %>%
# roate star by mutliplying points by rotation matrix
mutate(long = x * cos(pi / 2) + y * -sin(pi / 2),
lat = x * sin(pi / 2) + y * cos(pi / 2)) %>%
# scale the plots big time
mutate(long = long,
lat = lat) %>%
# transpose the plot to near DC
mutate(long = long - 75,
lat = lat + 37) %>%
select(-x, -y)
# combine states and territories ------------------------------------------
ccdf <- rbind(fifty_states, star) %>%
filter(id %in% c("11", ellided_areas)) %>%
rename(state_fips = id)
ids <- tribble(~state_name, ~state_abbv, ~state_fips,
"Alaska", "AK", "02",
"Hawaii", "HI", "15",
"American Samoa", "AS", "60",
"Commonwealth of the Northern Mariana Islands", "MP", "69",
"Guam", "GU", "66",
"Puerto Rico", "PR", "72",
"United States Virgin Islands", "VI", "52",
"United States Virgin Islands", "VI", "78",
"Washington, D.C.", "DC", "11")
ccdf <- left_join(ccdf, ids, by = "state_fips")
ccdf
}
# download and clean state fips data from census
get_state_fips <- function() {
state_fips <-
tribble(~state_fips, ~state_abbv, ~state_name,
"01", "AL", "Alabama",
"02", "AK", "Alaska",
"04", "AZ", "Arizona",
"05", "AR", "Arkansas",
"06", "CA", "California",
"08", "CO", "Colorado",
"09", "CT", "Connecticut",
"10", "DE", "Delaware",
"11", "DC", "District of Columbia",
"12", "FL", "Florida",
"13", "GA", "Georgia",
"15", "HI", "Hawaii",
"16", "ID", "Idaho",
"17", "IL", "Illinois",
"18", "IN", "Indiana",
"19", "IA", "Iowa",
"20", "KS", "Kansas",
"21", "KY", "Kentucky",
"22", "LA", "Louisiana",
"23", "ME", "Maine",
"24", "MD", "Maryland",
"25", "MA", "Massachusetts",
"26", "MI", "Michigan",
"27", "MN", "Minnesota",
"28", "MS", "Mississippi",
"29", "MO", "Missouri",
"30", "MT", "Montana",
"31", "NE", "Nebraska",
"32", "NV", "Nevada",
"33", "NH", "New Hampshire",
"34", "NJ", "New Jersey",
"35", "NM", "New Mexico",
"36", "NY", "New York",
"37", "NC", "North Carolina",
"38", "ND", "North Dakota",
"39", "OH", "Ohio",
"40", "OK", "Oklahoma",
"41", "OR", "Oregon",
"42", "PA", "Pennsylvania",
"44", "RI", "Rhode Island",
"45", "SC", "South Carolina",
"46", "SD", "South Dakota",
"47", "TN", "Tennessee",
"48", "TX", "Texas",
"49", "UT", "Utah",
"50", "VT", "Vermont",
"51", "VA", "Virginia",
"53", "WA", "Washington",
"54", "WV", "West Virginia",
"55", "WI", "Wisconsin",
"56", "WY", "Wyoming",
"60", "AS", "American Samoa",
"66", "GU", "Guam",
"69", "MP", "Mariana Islands",
"72", "PR", "Puerto Rico",
"78", "VI", "Virgin Islands")
state_fips
}
# download and clean county fips data from census
get_county_fips <- function() {
url <- 'https://www2.census.gov/geo/docs/reference/codes/national_county.txt'
county_fips <-
read_csv(url,
col_names = c('state_abbv', 'state_fips', 'county_fips', 'county_name', 'fips_class'),
col_types = 'ccccc') %>%
mutate(county_fips = paste0(state_fips, county_fips)) %>%
# recode county changes - see https://www.census.gov/geo/reference/county-changes.html
# Shannon County, SD changed name to Oglala Lakota County effective May 1, 2015
mutate(county_name = if_else(county_fips == '46113', 'Oglala Lakota County', county_name)) %>%
mutate(county_fips = if_else(county_fips == '46113', '46102', county_fips)) %>%
# Wade Hampton Census Area, AK changed name and code to Kusilvak Census Area effective July 1, 2015
mutate(county_name = if_else(county_fips == '02270', 'Kusilvak Census Area', county_name)) %>%
mutate(county_fips = if_else(county_fips == '02270', '02158', county_fips)) %>%
# add in state name from state fips file
left_join(get_state_fips())
county_fips
}
================================================
FILE: docs/CODE_OF_CONDUCT.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contributor Code of Conduct • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="Contributor Code of Conduct" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-title-body">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Contributor Code of Conduct</h1>
</div>
<div id="contributor-code-of-conduct" class="section level1">
<p>As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.</p>
<p>We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.</p>
<p>Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.</p>
<p>Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.</p>
<p>Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.</p>
<p>This Code of Conduct is adapted from the <a href="http:contributor-covenant.org">Contributor Covenant</a>, version 1.0.0, available at <a href="https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html" class="uri">https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html</a></p>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/articles/index.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Articles • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Articles" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article-index">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Articles</h1>
</div>
<div class="section ">
<h3>All vignettes</h3>
<p class="section-desc"></p>
<ul>
<li><a href="introducing-urbnmapr.html">Introducing urbnmapr</a></li>
</ul>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/articles/introducing-urbnmapr.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Introducing urbnmapr • urbnmapr</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Introducing urbnmapr">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Introducing urbnmapr</h1>
<h4 class="author">Vignette Author</h4>
<h4 class="date">2019-05-31</h4>
<small class="dont-index">Source: <a href="https://github.com/UrbanInstitute/urbnmapr/blob/master/vignettes/introducing-urbnmapr.Rmd"><code>vignettes/introducing-urbnmapr.Rmd</code></a></small>
<div class="hidden name"><code>introducing-urbnmapr.Rmd</code></div>
</div>
<p>The <code>urbnmapr</code> package provides state, county, and other shapefiles in <code>tibble</code> format that is compatible to map with <code>ggplot2</code>. Shapefiles include Alaska and Hawaii, transformed to be displayed as insets within the continental United States.</p>
<p>This package is heavily inspired by and derived in part from the <a href="https://cran.r-project.org/package=fiftystater">fiftystater package</a> by William Murphy. In contrast, <code>urbnmapr</code>:</p>
<ul>
<li>Uses shapefiles from the US Census Bureau</li>
<li>Converts the shapefile data to a <code>tibble</code> data frame</li>
<li>Adds various identifiers for merging</li>
<li>Includes a county-level shapefile</li>
</ul>
<div id="getting-data" class="section level2">
<h2 class="hasAnchor">
<a href="#getting-data" class="anchor"></a>Getting data</h2>
<p>There are two methods for accessing map data in <code>urbnmapr</code>. First, <code>urbnmapr</code> contains two <code>tibble</code> data frames, <code>states</code> and <code>counties</code>, for easily accessing simple state and county map data.</p>
<p>The <code>states</code> and <code>counties</code> tibbles can be used with <code>geom_polygon()</code> and <code>coord_map()</code> to create base maps of the continental United States, with Alaska and Hawaii displayed as insets:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(tidyverse)
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(urbnmapr)
states <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/blank-states-1.png" width="700"></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">counties <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.05</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/blank-counties-1.png" width="700"></p>
<p>Second, the function <code><a href="../reference/get_urbn_map.html">get_urbn_map()</a></code> accesses additional maps including “ccdf”, which includes elided territories roughly positioned in the direction of their true location, and “territories_counties”, which includes territories below the continuous 48 states.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">ccdf <-<span class="st"> </span><span class="kw"><a href="../reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"territories_counties"</span>)
ccdf <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">scale_x_continuous</span>(<span class="dt">limits =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="op">-</span><span class="dv">141</span>, <span class="op">-</span><span class="dv">55</span>)) <span class="op">+</span>
<span class="st"> </span><span class="kw">scale_y_continuous</span>(<span class="dt">limits =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">24</span>, <span class="dv">50</span>)) <span class="op">+</span><span class="st"> </span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/blank-territories-counties-1.png" width="700"></p>
</div>
<div id="merging-data" class="section level2">
<h2 class="hasAnchor">
<a href="#merging-data" class="anchor"></a>Merging data</h2>
<p>All tibbles include various identifiers to simplify merging data. The states <code>states</code> tibble contains <code>state_fips</code>, <code>state_abbv</code>, and <code>state_name</code>. The <code>counties</code> tibble contains <code>county_fips</code>, <code>state_abbv</code>, <code>state_fips</code>, <code>county_name</code>, and <code>state_name</code>. Both tibbles can be piped into <code>ggplot2</code> to create a choropleth map.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">statedata <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">left_join</span>(states, <span class="dt">by =</span> <span class="st">"state_name"</span>) <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group, <span class="dt">fill =</span> horate)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Homeownership rate"</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/us-choropleth-1.png" width="700"></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">household_data <-<span class="st"> </span><span class="kw">left_join</span>(countydata, counties, <span class="dt">by =</span> <span class="st">"county_fips"</span>)
household_data <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group, <span class="dt">fill =</span> medhhincome)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.05</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/county-1.png" width="700"></p>
</div>
<div id="labels" class="section level2">
<h2 class="hasAnchor">
<a href="#labels" class="anchor"></a>Labels</h2>
<p>The function <code><a href="../reference/get_urbn_labels.html">get_urbn_labels()</a></code> accesses additional labels including “ccdf”, which includes elided territories roughly positioned in the direction of their true location, and “territories_counties”, which includes territories below the continuous 48 states.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(tidyverse)
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(urbnmapr)
ccdf <-<span class="st"> </span><span class="kw"><a href="../reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"ccdf"</span>)
ccdf_labels <-<span class="st"> </span><span class="kw"><a href="../reference/get_urbn_labels.html">get_urbn_labels</a></span>(<span class="dt">map =</span> <span class="st">"ccdf"</span>)
ccdf <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group),
<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_text</span>(<span class="dt">data =</span> ccdf_labels, <span class="kw">aes</span>(long, lat, <span class="dt">label =</span> state_abbv), <span class="dt">size =</span> <span class="dv">3</span>) <span class="op">+</span><span class="st"> </span>
<span class="st"> </span><span class="kw">scale_x_continuous</span>(<span class="dt">limits =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="op">-</span><span class="dv">141</span>, <span class="op">-</span><span class="dv">55</span>)) <span class="op">+</span>
<span class="st"> </span><span class="kw">scale_y_continuous</span>(<span class="dt">limits =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">24</span>, <span class="dv">50</span>)) <span class="op">+</span><span class="st"> </span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/blank-ccdf-labels-1.png" width="700"></p>
</div>
<div id="styles" class="section level2">
<h2 class="hasAnchor">
<a href="#styles" class="anchor"></a>Styles</h2>
<p><code><a href="https://www.rdocumentation.org/packages/base/topics/library">library(urbnmapr)</a></code> works well with the <a href="https://github.com/UI-Research/urbnthemes">library(urbnthemes)</a></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(urbnthemes)
<span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/set_urbn_defaults">set_urbn_defaults</a></span>(<span class="dt">style =</span> <span class="st">"map"</span>)
statedata <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">left_join</span>(states, <span class="dt">by =</span> <span class="st">"state_name"</span>) <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group, <span class="dt">fill =</span> horate)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/scale_fill_gradientn">scale_fill_gradientn</a></span>(<span class="dt">labels =</span> scales<span class="op">::</span>percent) <span class="op">+</span>
<span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position =</span> <span class="st">"right"</span>,
<span class="dt">legend.direction =</span> <span class="st">"vertical"</span>,
<span class="dt">legend.title =</span> <span class="kw">element_text</span>(<span class="dt">face =</span> <span class="st">"bold"</span>, <span class="dt">size =</span> <span class="dv">11</span>),
<span class="dt">legend.key.height =</span> <span class="kw">unit</span>(.<span class="dv">2</span>, <span class="st">"in"</span>)) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Homeownership rate"</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/theme-state-1.png" width="700"></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">household_data <span class="op">%>%</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(state_name <span class="op">%in%</span><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"Virginia"</span>, <span class="st">"Maryland"</span>, <span class="st">"District of Columbia"</span>)) <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group, <span class="dt">fill =</span> medhhincome)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.05</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/scale_fill_gradientn">scale_fill_gradientn</a></span>(<span class="dt">labels =</span> scales<span class="op">::</span>dollar) <span class="op">+</span>
<span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position =</span> <span class="st">"right"</span>,
<span class="dt">legend.direction =</span> <span class="st">"vertical"</span>,
<span class="dt">legend.title =</span> <span class="kw">element_text</span>(<span class="dt">face =</span> <span class="st">"bold"</span>, <span class="dt">size =</span> <span class="dv">11</span>),
<span class="dt">legend.key.height =</span> <span class="kw">unit</span>(.<span class="dv">25</span>, <span class="st">"in"</span>)) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Median household income"</span>)</code></pre></div>
<p><img src="introducing-urbnmapr_files/figure-html/theme-counties-1.png" width="700"></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#getting-data">Getting data</a></li>
<li><a href="#merging-data">Merging data</a></li>
<li><a href="#labels">Labels</a></li>
<li><a href="#styles">Styles</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/articles/start-to-finish.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Start to finish • urbnmapr</title>
<!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Start to finish">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">0.0.0.9001</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
<li>
<a href="../articles/start-to-finish.html">Start to finish</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Start to finish</h1>
<small class="dont-index">Source: <a href="https://github.com/UrbanInstitute/urbnmapr/blob/master/vignettes/start-to-finish.Rmd"><code>vignettes/start-to-finish.Rmd</code></a></small>
<div class="hidden name"><code>start-to-finish.Rmd</code></div>
</div>
<div id="state-choropleth" class="section level2">
<h2 class="hasAnchor">
<a href="#state-choropleth" class="anchor"></a>State choropleth</h2>
<div id="packages" class="section level3">
<h3 class="hasAnchor">
<a href="#packages" class="anchor"></a>Packages</h3>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(tidyverse)
<span class="kw">library</span>(urbnmapr)
<span class="kw">source</span>(<span class="st">"https://raw.githubusercontent.com/UrbanInstitute/urban_R_theme/urban_R_theme_revamp/urban_theme.R"</span>)</code></pre></div>
<pre><code>## Warning: New theme missing the following elements: plot.tag,
## plot.tag.position</code></pre>
</div>
<div id="merge-data" class="section level3">
<h3 class="hasAnchor">
<a href="#merge-data" class="anchor"></a>Merge data</h3>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">USArrests_merged <-<span class="st"> </span>USArrests <span class="op">%>%</span>
<span class="st"> </span><span class="kw">rownames_to_column</span>(<span class="st">"state_name"</span>) <span class="op">%>%</span>
<span class="st"> </span><span class="kw">select</span>(state_name, Murder) <span class="op">%>%</span>
<span class="st"> </span><span class="kw">left_join</span>(states, <span class="dt">by =</span> <span class="st">"state_name"</span>)</code></pre></div>
</div>
<div id="pick-a-projection" class="section level3">
<h3 class="hasAnchor">
<a href="#pick-a-projection" class="anchor"></a>Pick a projection</h3>
<p>The world is approximately a 3-dimensional sphere. Maps are two-dimensional. Projections are transformations from points on the sphere to points on a map. Different situations require different projections. The Albers Equal-Area Conic Projection is a common choice for choropleths of the entire United States.</p>
<p>Add <code>coord_map(projection = "albers", lat0 = 39, lat1 = 45)</code> to your <code>ggplot2</code> call to use this projection.</p>
</div>
<div id="plot" class="section level3">
<h3 class="hasAnchor">
<a href="#plot" class="anchor"></a>Plot</h3>
<p>Plot the merged data set from above using <code>library(ggplot2)</code>. <code>long</code>, <code>lat</code>, and <code>group</code></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"> USArrests_merged <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>(long, lat, <span class="dt">group =</span> group, <span class="dt">fill =</span> Murder)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_polygon</span>(<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_map</span>(<span class="dt">projection =</span> <span class="st">"albers"</span>, <span class="dt">lat0 =</span> <span class="dv">39</span>, <span class="dt">lat1 =</span> <span class="dv">45</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">scale_fill_gradientn</span>() <span class="op">+</span>
<span class="st"> </span>urban_map <span class="op">+</span>
<span class="st"> </span><span class="kw">theme</span>(<span class="dt">legend.position =</span> <span class="st">"right"</span>,
<span class="dt">legend.direction =</span> <span class="st">"vertical"</span>,
<span class="dt">legend.title =</span> <span class="kw">element_text</span>(<span class="dt">face =</span> <span class="st">"bold"</span>, <span class="dt">size =</span> <span class="dv">11</span>))</code></pre></div>
<p><img src="start-to-finish_files/figure-html/unnamed-chunk-1-1.png" width="700"></p>
</div>
<div id="save" class="section level3">
<h3 class="hasAnchor">
<a href="#save" class="anchor"></a>Save</h3>
</div>
<div id="export" class="section level3">
<h3 class="hasAnchor">
<a href="#export" class="anchor"></a>Export</h3>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#state-choropleth">State choropleth</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/authors.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Authors • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="Authors" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-authors">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Authors</h1>
</div>
<ul class="list-unstyled">
<li>
<p><strong>Sarah Strochak</strong>. Author, maintainer.
</p>
</li>
<li>
<p><strong>Kyle Ueyama</strong>. Author.
</p>
</li>
<li>
<p><strong>Aaron Williams</strong>. Author.
</p>
</li>
<li>
<p><strong> Urban Institute</strong>. Copyright holder.
</p>
</li>
<li>
<p><strong>William Murphy</strong>. Contributor, copyright holder.
<br /><small>Original author for copied and derived code for fiftystater</small></p>
</li>
<li>
<p><strong>Barry Rowlingson</strong>. Contributor.
<br /><small>Original author for copied and derived code for fiftystater</small></p>
</li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/docsearch.css
================================================
/* Docsearch -------------------------------------------------------------- */
/*
Source: https://github.com/algolia/docsearch/
License: MIT
*/
.algolia-autocomplete {
display: block;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1
}
.algolia-autocomplete .ds-dropdown-menu {
width: 100%;
min-width: none;
max-width: none;
padding: .75rem 0;
background-color: #fff;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, .1);
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175);
}
@media (min-width:768px) {
.algolia-autocomplete .ds-dropdown-menu {
width: 175%
}
}
.algolia-autocomplete .ds-dropdown-menu::before {
display: none
}
.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] {
padding: 0;
background-color: rgb(255,255,255);
border: 0;
max-height: 80vh;
}
.algolia-autocomplete .ds-dropdown-menu .ds-suggestions {
margin-top: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion {
padding: 0;
overflow: visible
}
.algolia-autocomplete .algolia-docsearch-suggestion--category-header {
padding: .125rem 1rem;
margin-top: 0;
font-size: 1.3em;
font-weight: 500;
color: #00008B;
border-bottom: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion--wrapper {
float: none;
padding-top: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column {
float: none;
width: auto;
padding: 0;
text-align: left
}
.algolia-autocomplete .algolia-docsearch-suggestion--content {
float: none;
width: auto;
padding: 0
}
.algolia-autocomplete .algolia-docsearch-suggestion--content::before {
display: none
}
.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header {
padding-top: .75rem;
margin-top: .75rem;
border-top: 1px solid rgba(0, 0, 0, .1)
}
.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column {
display: block;
padding: .1rem 1rem;
margin-bottom: 0.1;
font-size: 1.0em;
font-weight: 400
/* display: none */
}
.algolia-autocomplete .algolia-docsearch-suggestion--title {
display: block;
padding: .25rem 1rem;
margin-bottom: 0;
font-size: 0.9em;
font-weight: 400
}
.algolia-autocomplete .algolia-docsearch-suggestion--text {
padding: 0 1rem .5rem;
margin-top: -.25rem;
font-size: 0.8em;
font-weight: 400;
line-height: 1.25
}
.algolia-autocomplete .algolia-docsearch-footer {
width: 110px;
height: 20px;
z-index: 3;
margin-top: 10.66667px;
float: right;
font-size: 0;
line-height: 0;
}
.algolia-autocomplete .algolia-docsearch-footer--logo {
background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 130 18' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient x1='-36.868%' y1='134.936%' x2='129.432%' y2='-27.7%' id='a'><stop stop-color='%2300AEFF' offset='0%'/><stop stop-color='%233369E7' offset='100%'/></linearGradient></defs><g fill='none' fill-rule='evenodd'><path d='M59.399.022h13.299a2.372 2.372 0 0 1 2.377 2.364V15.62a2.372 2.372 0 0 1-2.377 2.364H59.399a2.372 2.372 0 0 1-2.377-2.364V2.381A2.368 2.368 0 0 1 59.399.022z' fill='url(%23a)'/><path d='M66.257 4.56c-2.815 0-5.1 2.272-5.1 5.078 0 2.806 2.284 5.072 5.1 5.072 2.815 0 5.1-2.272 5.1-5.078 0-2.806-2.279-5.072-5.1-5.072zm0 8.652c-1.983 0-3.593-1.602-3.593-3.574 0-1.972 1.61-3.574 3.593-3.574 1.983 0 3.593 1.602 3.593 3.574a3.582 3.582 0 0 1-3.593 3.574zm0-6.418v2.664c0 .076.082.131.153.093l2.377-1.226c.055-.027.071-.093.044-.147a2.96 2.96 0 0 0-2.465-1.487c-.055 0-.11.044-.11.104l.001-.001zm-3.33-1.956l-.312-.311a.783.783 0 0 0-1.106 0l-.372.37a.773.773 0 0 0 0 1.101l.307.305c.049.049.121.038.164-.011.181-.245.378-.479.597-.697.225-.223.455-.42.707-.599.055-.033.06-.109.016-.158h-.001zm5.001-.806v-.616a.781.781 0 0 0-.783-.779h-1.824a.78.78 0 0 0-.783.779v.632c0 .071.066.12.137.104a5.736 5.736 0 0 1 1.588-.223c.52 0 1.035.071 1.534.207a.106.106 0 0 0 .131-.104z' fill='%23FFF'/><path d='M102.162 13.762c0 1.455-.372 2.517-1.123 3.193-.75.676-1.895 1.013-3.44 1.013-.564 0-1.736-.109-2.673-.316l.345-1.689c.783.163 1.819.207 2.361.207.86 0 1.473-.174 1.84-.523.367-.349.548-.866.548-1.553v-.349a6.374 6.374 0 0 1-.838.316 4.151 4.151 0 0 1-1.194.158 4.515 4.515 0 0 1-1.616-.278 3.385 3.385 0 0 1-1.254-.817 3.744 3.744 0 0 1-.811-1.351c-.192-.539-.29-1.504-.29-2.212 0-.665.104-1.498.307-2.054a3.925 3.925 0 0 1 .904-1.433 4.124 4.124 0 0 1 1.441-.926 5.31 5.31 0 0 1 1.945-.365c.696 0 1.337.087 1.961.191a15.86 15.86 0 0 1 1.588.332v8.456h-.001zm-5.954-4.206c0 .893.197 1.885.592 2.299.394.414.904.621 1.528.621.34 0 .663-.049.964-.142a2.75 2.75 0 0 0 .734-.332v-5.29a8.531 8.531 0 0 0-1.413-.18c-.778-.022-1.369.294-1.786.801-.411.507-.619 1.395-.619 2.223zm16.12 0c0 .719-.104 1.264-.318 1.858a4.389 4.389 0 0 1-.904 1.52c-.389.42-.854.746-1.402.975-.548.229-1.391.36-1.813.36-.422-.005-1.26-.125-1.802-.36a4.088 4.088 0 0 1-1.397-.975 4.486 4.486 0 0 1-.909-1.52 5.037 5.037 0 0 1-.329-1.858c0-.719.099-1.411.318-1.999.219-.588.526-1.09.92-1.509.394-.42.865-.741 1.402-.97a4.547 4.547 0 0 1 1.786-.338 4.69 4.69 0 0 1 1.791.338c.548.229 1.019.55 1.402.97.389.42.69.921.909 1.509.23.588.345 1.28.345 1.999h.001zm-2.191.005c0-.921-.203-1.689-.597-2.223-.394-.539-.948-.806-1.654-.806-.707 0-1.26.267-1.654.806-.394.539-.586 1.302-.586 2.223 0 .932.197 1.558.592 2.098.394.545.948.812 1.654.812.707 0 1.26-.272 1.654-.812.394-.545.592-1.166.592-2.098h-.001zm6.962 4.707c-3.511.016-3.511-2.822-3.511-3.274L113.583.926l2.142-.338v10.003c0 .256 0 1.88 1.375 1.885v1.792h-.001zm3.774 0h-2.153V5.072l2.153-.338v9.534zm-1.079-10.542c.718 0 1.304-.578 1.304-1.291 0-.714-.581-1.291-1.304-1.291-.723 0-1.304.578-1.304 1.291 0 .714.586 1.291 1.304 1.291zm6.431 1.013c.707 0 1.304.087 1.786.262.482.174.871.42 1.156.73.285.311.488.735.608 1.182.126.447.186.937.186 1.476v5.481a25.24 25.24 0 0 1-1.495.251c-.668.098-1.419.147-2.251.147a6.829 6.829 0 0 1-1.517-.158 3.213 3.213 0 0 1-1.178-.507 2.455 2.455 0 0 1-.761-.904c-.181-.37-.274-.893-.274-1.438 0-.523.104-.855.307-1.215.208-.36.487-.654.838-.883a3.609 3.609 0 0 1 1.227-.49 7.073 7.073 0 0 1 2.202-.103c.263.027.537.076.833.147v-.349c0-.245-.027-.479-.088-.697a1.486 1.486 0 0 0-.307-.583c-.148-.169-.34-.3-.581-.392a2.536 2.536 0 0 0-.915-.163c-.493 0-.942.06-1.353.131-.411.071-.75.153-1.008.245l-.257-1.749c.268-.093.668-.185 1.183-.278a9.335 9.335 0 0 1 1.66-.142l-.001-.001zm.181 7.731c.657 0 1.145-.038 1.484-.104v-2.168a5.097 5.097 0 0 0-1.978-.104c-.241.033-.46.098-.652.191a1.167 1.167 0 0 0-.466.392c-.121.169-.175.267-.175.523 0 .501.175.79.493.981.323.196.75.289 1.293.289h.001zM84.109 4.794c.707 0 1.304.087 1.786.262.482.174.871.42 1.156.73.29.316.487.735.608 1.182.126.447.186.937.186 1.476v5.481a25.24 25.24 0 0 1-1.495.251c-.668.098-1.419.147-2.251.147a6.829 6.829 0 0 1-1.517-.158 3.213 3.213 0 0 1-1.178-.507 2.455 2.455 0 0 1-.761-.904c-.181-.37-.274-.893-.274-1.438 0-.523.104-.855.307-1.215.208-.36.487-.654.838-.883a3.609 3.609 0 0 1 1.227-.49 7.073 7.073 0 0 1 2.202-.103c.257.027.537.076.833.147v-.349c0-.245-.027-.479-.088-.697a1.486 1.486 0 0 0-.307-.583c-.148-.169-.34-.3-.581-.392a2.536 2.536 0 0 0-.915-.163c-.493 0-.942.06-1.353.131-.411.071-.75.153-1.008.245l-.257-1.749c.268-.093.668-.185 1.183-.278a8.89 8.89 0 0 1 1.66-.142l-.001-.001zm.186 7.736c.657 0 1.145-.038 1.484-.104v-2.168a5.097 5.097 0 0 0-1.978-.104c-.241.033-.46.098-.652.191a1.167 1.167 0 0 0-.466.392c-.121.169-.175.267-.175.523 0 .501.175.79.493.981.318.191.75.289 1.293.289h.001zm8.682 1.738c-3.511.016-3.511-2.822-3.511-3.274L89.461.926l2.142-.338v10.003c0 .256 0 1.88 1.375 1.885v1.792h-.001z' fill='%23182359'/><path d='M5.027 11.025c0 .698-.252 1.246-.757 1.644-.505.397-1.201.596-2.089.596-.888 0-1.615-.138-2.181-.414v-1.214c.358.168.739.301 1.141.397.403.097.778.145 1.125.145.508 0 .884-.097 1.125-.29a.945.945 0 0 0 .363-.779.978.978 0 0 0-.333-.747c-.222-.204-.68-.446-1.375-.725-.716-.29-1.221-.621-1.515-.994-.294-.372-.44-.82-.44-1.343 0-.655.233-1.171.698-1.547.466-.376 1.09-.564 1.875-.564.752 0 1.5.165 2.245.494l-.408 1.047c-.698-.294-1.321-.44-1.869-.44-.415 0-.73.09-.945.271a.89.89 0 0 0-.322.717c0 .204.043.379.129.524.086.145.227.282.424.411.197.129.551.299 1.063.51.577.24.999.464 1.268.671.269.208.466.442.591.704.125.261.188.569.188.924l-.001.002zm3.98 2.24c-.924 0-1.646-.269-2.167-.808-.521-.539-.782-1.281-.782-2.226 0-.97.242-1.733.725-2.288.483-.555 1.148-.833 1.993-.833.784 0 1.404.238 1.858.714.455.476.682 1.132.682 1.966v.682H7.357c.018.577.174 1.02.467 1.329.294.31.707.465 1.241.465.351 0 .678-.033.98-.099a5.1 5.1 0 0 0 .975-.33v1.026a3.865 3.865 0 0 1-.935.312 5.723 5.723 0 0 1-1.08.091l.002-.001zm-.231-5.199c-.401 0-.722.127-.964.381s-.386.625-.432 1.112h2.696c-.007-.491-.125-.862-.354-1.115-.229-.252-.544-.379-.945-.379l-.001.001zm7.692 5.092l-.252-.827h-.043c-.286.362-.575.608-.865.739-.29.131-.662.196-1.117.196-.584 0-1.039-.158-1.367-.473-.328-.315-.491-.761-.491-1.337 0-.612.227-1.074.682-1.386.455-.312 1.148-.482 2.079-.51l1.026-.032v-.317c0-.38-.089-.663-.266-.851-.177-.188-.452-.282-.824-.282-.304 0-.596.045-.876.134a6.68 6.68 0 0 0-.806.317l-.408-.902a4.414 4.414 0 0 1 1.058-.384 4.856 4.856 0 0 1 1.085-.132c.756 0 1.326.165 1.711.494.385.329.577.847.577 1.552v4.002h-.902l-.001-.001zm-1.88-.859c.458 0 .826-.128 1.104-.384.278-.256.416-.615.416-1.077v-.516l-.763.032c-.594.021-1.027.121-1.297.298s-.406.448-.406.814c0 .265.079.47.236.615.158.145.394.218.709.218h.001zm7.557-5.189c.254 0 .464.018.628.054l-.124 1.176a2.383 2.383 0 0 0-.559-.064c-.505 0-.914.165-1.227.494-.313.329-.47.757-.47 1.284v3.105h-1.262V7.218h.988l.167 1.047h.064c.197-.354.454-.636.771-.843a1.83 1.83 0 0 1 1.023-.312h.001zm4.125 6.155c-.899 0-1.582-.262-2.049-.787-.467-.525-.701-1.277-.701-2.259 0-.999.244-1.767.733-2.304.489-.537 1.195-.806 2.119-.806.627 0 1.191.116 1.692.349l-.381 1.015c-.534-.208-.974-.312-1.321-.312-1.028 0-1.542.682-1.542 2.046 0 .666.128 1.166.384 1.501.256.335.631.502 1.125.502a3.23 3.23 0 0 0 1.595-.419v1.101a2.53 2.53 0 0 1-.722.285 4.356 4.356 0 0 1-.932.086v.002zm8.277-.107h-1.268V9.506c0-.458-.092-.8-.277-1.026-.184-.226-.477-.338-.878-.338-.53 0-.919.158-1.168.475-.249.317-.373.848-.373 1.593v2.949h-1.262V4.801h1.262v2.122c0 .34-.021.704-.064 1.09h.081a1.76 1.76 0 0 1 .717-.666c.306-.158.663-.236 1.072-.236 1.439 0 2.159.725 2.159 2.175v3.873l-.001-.001zm7.649-6.048c.741 0 1.319.269 1.732.806.414.537.62 1.291.62 2.261 0 .974-.209 1.732-.628 2.275-.419.542-1.001.814-1.746.814-.752 0-1.336-.27-1.751-.811h-.086l-.231.704h-.945V4.801h1.262v1.987l-.021.655-.032.553h.054c.401-.591.992-.886 1.772-.886zm-.328 1.031c-.508 0-.875.149-1.098.448-.224.299-.339.799-.346 1.501v.086c0 .723.115 1.247.344 1.571.229.324.603.486 1.123.486.448 0 .787-.177 1.018-.532.231-.354.346-.867.346-1.536 0-1.35-.462-2.025-1.386-2.025l-.001.001zm3.244-.924h1.375l1.209 3.368c.183.48.304.931.365 1.354h.043c.032-.197.091-.436.177-.717.086-.281.541-1.616 1.364-4.004h1.364l-2.541 6.73c-.462 1.235-1.232 1.853-2.31 1.853-.279 0-.551-.03-.816-.091v-.999c.19.043.406.064.65.064.609 0 1.037-.353 1.284-1.058l.22-.559-2.385-5.941h.001z' fill='%231D3657'/></g></svg>");
background-repeat: no-repeat;
background-position: 50%;
background-size: 100%;
overflow: hidden;
text-indent: -9000px;
width: 100%;
height: 100%;
display: block;
transform: translate(-8px);
}
.algolia-autocomplete .algolia-docsearch-suggestion--highlight {
color: #FF8C00;
background: rgba(232, 189, 54, 0.1)
}
.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {
box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5)
}
.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content {
background-color: rgba(192, 192, 192, .15)
}
================================================
FILE: docs/docsearch.js
================================================
$(function() {
// register a handler to move the focus to the search bar
// upon pressing shift + "/" (i.e. "?")
$(document).on('keydown', function(e) {
if (e.shiftKey && e.keyCode == 191) {
e.preventDefault();
$("#search-input").focus();
}
});
$(document).ready(function() {
// do keyword highlighting
/* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */
var mark = function() {
var referrer = document.URL ;
var paramKey = "q" ;
if (referrer.indexOf("?") !== -1) {
var qs = referrer.substr(referrer.indexOf('?') + 1);
var qs_noanchor = qs.split('#')[0];
var qsa = qs_noanchor.split('&');
var keyword = "";
for (var i = 0; i < qsa.length; i++) {
var currentParam = qsa[i].split('=');
if (currentParam.length !== 2) {
continue;
}
if (currentParam[0] == paramKey) {
keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20"));
}
}
if (keyword !== "") {
$(".contents").unmark({
done: function() {
$(".contents").mark(keyword);
}
});
}
}
};
mark();
});
});
/* Search term highlighting ------------------------------*/
function matchedWords(hit) {
var words = [];
var hierarchy = hit._highlightResult.hierarchy;
// loop to fetch from lvl0, lvl1, etc.
for (var idx in hierarchy) {
words = words.concat(hierarchy[idx].matchedWords);
}
var content = hit._highlightResult.content;
if (content) {
words = words.concat(content.matchedWords);
}
// return unique words
var words_uniq = [...new Set(words)];
return words_uniq;
}
function updateHitURL(hit) {
var words = matchedWords(hit);
var url = "";
if (hit.anchor) {
url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor;
} else {
url = hit.url + '?q=' + escape(words.join(" "));
}
return url;
}
================================================
FILE: docs/index.html
================================================
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>State and county shapefiles in tibble format • urbnmapr</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="State and county shapefiles in tibble format">
<meta property="og:description" content="Provides state and county shapefiles in 'tibble' format that is
compatible to map with 'ggplot2'. Shapefiles include Alaska and Hawaii,
transformed to be displayed as insets within the continental United States.
Heavily inspired by and derived in part from the fiftystater
package <https://cran.r-project.org/package=fiftystater> by William Murphy.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<!-- README.md is generated from README.Rmd. Please edit that file -->
<div id="urbnmapr" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#urbnmapr" class="anchor"></a>urbnmapr <a href="https://urbaninstitute.github.io/urbnmapr/"><img src="reference/figures/hexsticker.png" align="right" height="160"></a>
</h1></div>
<p>The <code>urbnmapr</code> package provides state and county shapefiles that are compatible to map with <code>ggplot2</code>.</p>
<p>Shapefiles include Alaska and Hawaii, transformed to be displayed as insets within the continental United States. There are options to include the territories for both the state and county maps.</p>
<p>This package is heavily inspired by and derived in part from the <a href="https://cran.r-project.org/package=fiftystater">fiftystater package</a> by William Murphy. In contrast, <code>urbnmapr</code>:</p>
<ul>
<li>Uses shapefiles from the US Census Bureau</li>
<li>Converts the shapefile data to <code>sf</code> format</li>
<li>Adds various identifiers for merging</li>
<li>Includes a county-level shapefile and options to add territories</li>
</ul>
<div id="stay-up-to-date" class="section level2">
<h2 class="hasAnchor">
<a href="#stay-up-to-date" class="anchor"></a>Stay up-to-date</h2>
<p>Sign up <a href="https://app.smartsheet.com/b/form/9029a0a8254e4044a52cdebaebe343bf">here</a> to stay up-to-date with R package releases and R resources from the Urban Institute. We will not share your information and we will not email more than once per month.</p>
</div>
<div id="installation" class="section level2">
<h2 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h2>
<p>You can install the latest version of <code>urbnmapr</code> from GitHub:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># install.packages("devtools")</span>
devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_github</a></span>(<span class="st">"UrbanInstitute/urbnmapr"</span>)</code></pre></div>
</div>
<div id="usage" class="section level2">
<h2 class="hasAnchor">
<a href="#usage" class="anchor"></a>Usage</h2>
<div id="quick-maps" class="section level3">
<h3 class="hasAnchor">
<a href="#quick-maps" class="anchor"></a>Quick maps</h3>
<p>The <code><a href="reference/get_urbn_map.html">get_urbn_map()</a></code> function can be used to call shapefiles. Using the <code>sf = TRUE</code> option will load <code>sf</code> objects. These can be used with <code>geom_sf()</code> to create base maps of the continental United States, with Alaska and Hawaii displayed as insets:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(tidyverse)
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(urbnmapr)
states_sf <-<span class="st"> </span><span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="st">"states"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>)
states_sf <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>()) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>)</code></pre></div>
<p><img src="index_files/figure-html/sf-state-1.png" width="700"></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(tidyverse)
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(urbnmapr)
counties_sf <-<span class="st"> </span><span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="st">"counties"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>)
counties_sf <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="kw">aes</span>()) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>)</code></pre></div>
<p><img src="index_files/figure-html/sf-county-1.png" width="700"></p>
<p>The default projection is US National Atlas Equal Area.</p>
</div>
<div id="more-maps" class="section level3">
<h3 class="hasAnchor">
<a href="#more-maps" class="anchor"></a>More maps</h3>
<p>Maps with US territories can also be called with <code><a href="reference/get_urbn_map.html">get_urbn_map()</a></code>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">territories_counties <-<span class="st"> </span><span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"territories_counties"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>)
<span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(territories_counties,
<span class="dt">mapping =</span> <span class="kw">aes</span>(),
<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>)</code></pre></div>
<p><img src="index_files/figure-html/terr-1.png" width="700"></p>
</div>
<div id="labels" class="section level3">
<h3 class="hasAnchor">
<a href="#labels" class="anchor"></a>Labels</h3>
<p>Labels for states maps can be accessed with <code><a href="reference/get_urbn_labels.html">get_urbn_labels()</a></code>. Only state labels are custom, so they can be displayed next to smaller states. Use the function to call the appropriate labels and then label the map with <code>geom_sf_text()</code>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">states_sf <-<span class="st"> </span><span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"states"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>)
states_sf <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(<span class="kw">aes</span>(),
<span class="dt">fill =</span> <span class="st">"grey"</span>, <span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf_text</span>(<span class="dt">data =</span> <span class="kw"><a href="reference/get_urbn_labels.html">get_urbn_labels</a></span>(<span class="dt">map =</span> <span class="st">"states"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>),
<span class="kw">aes</span>(<span class="dt">label =</span> state_abbv),
<span class="dt">size =</span> <span class="dv">3</span>)</code></pre></div>
<p><img src="index_files/figure-html/quick-labels-1.png" width="700"></p>
</div>
</div>
<div id="merging-data" class="section level2">
<h2 class="hasAnchor">
<a href="#merging-data" class="anchor"></a>Merging Data</h2>
<p>The states and counties spatial data include various identifiers to simplify merging data. The states <code>states</code> tibble contains <code>state_fips</code>, <code>state_abbv</code>, and <code>state_name</code>. The <code>counties</code> tibble contains <code>county_fips</code>, <code>state_abbv</code>, <code>state_fips</code>, <code>county_name</code>, and <code>state_name</code>.</p>
<p>Continuous data can be mapping on a color scale.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">spatial_data <-<span class="st"> </span><span class="kw">left_join</span>(statedata,
<span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"states"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>),
<span class="dt">by =</span> <span class="st">"state_name"</span>)
<span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(spatial_data,
<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">fill =</span> horate),
<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Homeownership rate"</span>)</code></pre></div>
<p><img src="index_files/figure-html/us-choropleth-1.png" width="700"></p>
<p>Categorical data can be mapped on a discrete color scale.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">counties_sf <-<span class="st"> </span><span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"counties"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>)
county_groups <-<span class="st"> </span>countydata <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">mutate</span>(<span class="dt">cat_var =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste0</a></span>(<span class="st">"Group "</span>,
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/sample">sample</a></span>(<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/nrow">nrow</a></span>(countydata), <span class="dt">replace =</span> <span class="ot">TRUE</span>)))
household_data <-<span class="st"> </span><span class="kw">left_join</span>(county_groups, counties_sf, <span class="dt">by =</span> <span class="st">"county_fips"</span>)
household_data <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">fill =</span> cat_var),
<span class="dt">color =</span> <span class="ot">NA</span>, <span class="dt">size =</span> <span class="fl">0.05</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Categorical variable"</span>)</code></pre></div>
<p><img src="index_files/figure-html/county-1.png" width="700"></p>
</div>
<div id="styles" class="section level2">
<h2 class="hasAnchor">
<a href="#styles" class="anchor"></a>Styles</h2>
<p><code><a href="https://www.rdocumentation.org/packages/base/topics/library">library(urbnmapr)</a></code> works well with the <a href="https://github.com/UrbanInstitute/urban_R_theme">Urban Institute <code>ggplot2</code> theme.</a></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(urbnthemes)
<span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/set_urbn_defaults">set_urbn_defaults</a></span>(<span class="dt">style =</span> <span class="st">"map"</span>)</code></pre></div>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">states_sf <-<span class="st"> </span><span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"states"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>)
statedata <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">left_join</span>(states_sf, <span class="dt">by =</span> <span class="st">"state_name"</span>) <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">fill =</span> horate),
<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.25</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/scale_fill_gradientn">scale_fill_gradientn</a></span>(<span class="dt">labels =</span> scales<span class="op">::</span>percent) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Homeownership rate"</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_sf</span>(<span class="dt">datum =</span> <span class="ot">NA</span>)</code></pre></div>
<p><img src="index_files/figure-html/theme-state-1.png" width="700"></p>
<p>Map smaller geographies with <code><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter()</a></code>. You may need to reproject the data based on which areas you are mapping.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">household_data <span class="op">%>%</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(state_name <span class="op">==</span><span class="st"> "California"</span>) <span class="op">%>%</span>
<span class="st"> </span><span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">fill =</span> medhhincome),
<span class="dt">color =</span> <span class="st">"#ffffff"</span>, <span class="dt">size =</span> <span class="fl">0.05</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_sf</span>(<span class="dt">datum =</span> <span class="ot">NA</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/scale_fill_gradientn">scale_fill_gradientn</a></span>(<span class="dt">labels =</span> scales<span class="op">::</span>dollar) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Median household income"</span>)</code></pre></div>
<p><img src="index_files/figure-html/theme-counties-1.png" width="700"></p>
<p>A discrete color scale can also be used for categorical data.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">state_categorical <-<span class="st"> </span>statedata <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">mutate</span>(<span class="dt">cat_var =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste0</a></span>(<span class="st">"Group "</span>,
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/sample">sample</a></span>(<span class="dv">1</span><span class="op">:</span><span class="dv">4</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/nrow">nrow</a></span>(statedata), <span class="dt">replace =</span> <span class="ot">TRUE</span>))) <span class="op">%>%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">left_join</span>(<span class="kw"><a href="reference/get_urbn_map.html">get_urbn_map</a></span>(<span class="dt">map =</span> <span class="st">"states"</span>, <span class="dt">sf =</span> <span class="ot">TRUE</span>), <span class="dt">by =</span> <span class="st">"state_name"</span>)
<span class="kw">ggplot</span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_sf</span>(state_categorical, <span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">fill =</span> cat_var),
<span class="dt">color =</span> <span class="st">"#ffffff"</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/urbnthemes/topics/scale_fill_discrete">scale_fill_discrete</a></span>() <span class="op">+</span>
<span class="st"> </span><span class="kw">coord_sf</span>(<span class="dt">datum =</span> <span class="ot">NA</span>) <span class="op">+</span>
<span class="st"> </span><span class="kw">labs</span>(<span class="dt">fill =</span> <span class="st">"Categorical variable"</span>)</code></pre></div>
<p><img src="index_files/figure-html/state-discrete-1.png" width="700"></p>
</div>
<div id="license" class="section level2">
<h2 class="hasAnchor">
<a href="#license" class="anchor"></a>License</h2>
<p>Code released under the GNU General Public License v3.0.</p>
</div>
<div id="code-of-conduct" class="section level2">
<h2 class="hasAnchor">
<a href="#code-of-conduct" class="anchor"></a>Code of conduct</h2>
<p>Please note that this project is released with a <a href="CODE_OF_CONDUCT.html">Contributor Code of Conduct</a>. By participating in this project you agree to abide by its terms.</p>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div class="links">
<h2>Links</h2>
<ul class="list-unstyled">
<li>Browse source code at <br><a href="https://github.com/UrbanInstitute/urbnmapr">https://github.com/UrbanInstitute/urbnmapr</a>
</li>
<li>Report a bug at <br><a href="https://github.com/UrbanInstitute/urbnmapr/issues">https://github.com/UrbanInstitute/urbnmapr/issues</a>
</li>
</ul>
</div>
<div class="license">
<h2>License</h2>
<ul class="list-unstyled">
<li><a href="https://www.r-project.org/Licenses/GPL-3">GPL-3</a></li>
</ul>
</div>
<div class="developers">
<h2>Developers</h2>
<ul class="list-unstyled">
<li>Sarah Strochak <br><small class="roles"> Author, maintainer </small> </li>
<li>Kyle Ueyama <br><small class="roles"> Author </small> </li>
<li>Aaron Williams <br><small class="roles"> Author </small> </li>
<li><a href="authors.html">All authors...</a></li>
</ul>
</div>
<div class="dev-status">
<h2>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://travis-ci.org/UrbanInstitute/urbnmapr"><img src="https://travis-ci.org/UrbanInstitute/urbnmapr.svg?branch=master" alt="Travis-CI Build Status"></a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/news/index.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Changelog • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Changelog" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-news">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Changelog <small></small></h1>
<small>Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="urbnmapr-0-0-0-9002" class="section level2">
<h2 class="hasAnchor">
<a href="#urbnmapr-0-0-0-9002" class="anchor"></a>urbnmapr 0.0.0.9002</h2>
<ul>
<li>Adds <code>SF</code> option to <code><a href="../reference/get_urbn_map.html">get_urbn_map()</a></code> and <code>get_urbn_label()</code>
</li>
<li>Add <a href="https://github.com/r-lib/pkgdown">pkgdown</a> website <a href="https://urbaninstitute.github.io/urbnmapr/">here</a>
</li>
</ul>
</div>
<div id="urbnmapr-0-0-0-9001" class="section level2">
<h2 class="hasAnchor">
<a href="#urbnmapr-0-0-0-9001" class="anchor"></a>urbnmapr 0.0.0.9001</h2>
<p>Two functions have been added to the package, with two additional shape options:</p>
<ul>
<li>
<code>get_urbn_map</code> will return the requested shapefile, parsed into a <code>tibble</code>
</li>
<li>
<code>get_urbn_labels</code> will return a <code>tibble</code> of coordinates and map labels</li>
</ul>
<p>The valid options for each are:</p>
<ol>
<li>states</li>
<li>counties</li>
<li>ccdf</li>
<li>territories</li>
<li>territories_counties</li>
</ol>
</div>
<div id="urbnmapr-0-0-0-9000" class="section level2">
<h2 class="hasAnchor">
<a href="#urbnmapr-0-0-0-9000" class="anchor"></a>urbnmapr 0.0.0.9000</h2>
<p>This is the initial release of the <code>urbnmapr</code> package. It includes state and county-level shapefiles parsed into a <code>tibble</code> for easy plotting with <code>ggplot2</code>.</p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#urbnmapr-0-0-0-9002">0.0.0.9002</a></li>
<li><a href="#urbnmapr-0-0-0-9001">0.0.0.9001</a></li>
<li><a href="#urbnmapr-0-0-0-9000">0.0.0.9000</a></li>
</ul>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/pkgdown.css
================================================
/* Sticky footer */
/**
* Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
* Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css
*
* .Site -> body > .container
* .Site-content -> body > .container .row
* .footer -> footer
*
* Key idea seems to be to ensure that .container and __all its parents__
* have height set to 100%
*
*/
html, body {
height: 100%;
}
body > .container {
display: flex;
height: 100%;
flex-direction: column;
padding-top: 60px;
}
body > .container .row {
flex: 1 0 auto;
}
footer {
margin-top: 45px;
padding: 35px 0 36px;
border-top: 1px solid #e5e5e5;
color: #666;
display: flex;
flex-shrink: 0;
}
footer p {
margin-bottom: 0;
}
footer div {
flex: 1;
}
footer .pkgdown {
text-align: right;
}
footer p {
margin-bottom: 0;
}
img.icon {
float: right;
}
img {
max-width: 100%;
}
/* Fix bug in bootstrap (only seen in firefox) */
summary {
display: list-item;
}
/* Typographic tweaking ---------------------------------*/
.contents .page-header {
margin-top: calc(-60px + 1em);
}
/* Section anchors ---------------------------------*/
a.anchor {
margin-left: -30px;
display:inline-block;
width: 30px;
height: 30px;
visibility: hidden;
background-image: url(./link.svg);
background-repeat: no-repeat;
background-size: 20px 20px;
background-position: center center;
}
.hasAnchor:hover a.anchor {
visibility: visible;
}
@media (max-width: 767px) {
.hasAnchor:hover a.anchor {
visibility: hidden;
}
}
/* Fixes for fixed navbar --------------------------*/
.contents h1, .contents h2, .contents h3, .contents h4 {
padding-top: 60px;
margin-top: -40px;
}
/* Static header placement on mobile devices */
@media (max-width: 767px) {
.navbar-fixed-top {
position: absolute;
}
.navbar {
padding: 0;
}
}
/* Sidebar --------------------------*/
#sidebar {
margin-top: 30px;
}
#sidebar h2 {
font-size: 1.5em;
margin-top: 1em;
}
#sidebar h2:first-child {
margin-top: 0;
}
#sidebar .list-unstyled li {
margin-bottom: 0.5em;
}
.orcid {
height: 16px;
vertical-align: middle;
}
/* Reference index & topics ----------------------------------------------- */
.ref-index th {font-weight: normal;}
.ref-index td {vertical-align: top;}
.ref-index .icon {width: 40px;}
.ref-index .alias {width: 40%;}
.ref-index-icons .alias {width: calc(40% - 40px);}
.ref-index .title {width: 60%;}
.ref-arguments th {text-align: right; padding-right: 10px;}
.ref-arguments th, .ref-arguments td {vertical-align: top;}
.ref-arguments .name {width: 20%;}
.ref-arguments .desc {width: 80%;}
/* Nice scrolling for wide elements --------------------------------------- */
table {
display: block;
overflow: auto;
}
/* Syntax highlighting ---------------------------------------------------- */
pre {
word-wrap: normal;
word-break: normal;
border: 1px solid #eee;
}
pre, code {
background-color: #f8f8f8;
color: #333;
}
pre code {
overflow: auto;
word-wrap: normal;
white-space: pre;
}
pre .img {
margin: 5px 0;
}
pre .img img {
background-color: #fff;
display: block;
height: auto;
}
code a, pre a {
color: #375f84;
}
a.sourceLine:hover {
text-decoration: none;
}
.fl {color: #1514b5;}
.fu {color: #000000;} /* function */
.ch,.st {color: #036a07;} /* string */
.kw {color: #264D66;} /* keyword */
.co {color: #888888;} /* comment */
.message { color: black; font-weight: bolder;}
.error { color: orange; font-weight: bolder;}
.warning { color: #6A0366; font-weight: bolder;}
/* Clipboard --------------------------*/
.hasCopyButton {
position: relative;
}
.btn-copy-ex {
position: absolute;
right: 0;
top: 0;
visibility: hidden;
}
.hasCopyButton:hover button.btn-copy-ex {
visibility: visible;
}
/* mark.js ----------------------------*/
mark {
background-color: rgba(255, 255, 51, 0.5);
border-bottom: 2px solid rgba(255, 153, 51, 0.3);
padding: 1px;
}
/* vertical spacing after htmlwidgets */
.html-widget {
margin-bottom: 10px;
}
================================================
FILE: docs/pkgdown.js
================================================
/* http://gregfranko.com/blog/jquery-best-practices/ */
(function($) {
$(function() {
$("#sidebar")
.stick_in_parent({offset_top: 40})
.on('sticky_kit:bottom', function(e) {
$(this).parent().css('position', 'static');
})
.on('sticky_kit:unbottom', function(e) {
$(this).parent().css('position', 'relative');
});
$('body').scrollspy({
target: '#sidebar',
offset: 60
});
$('[data-toggle="tooltip"]').tooltip();
var cur_path = paths(location.pathname);
var links = $("#navbar ul li a");
var max_length = -1;
var pos = -1;
for (var i = 0; i < links.length; i++) {
if (links[i].getAttribute("href") === "#")
continue;
// Ignore external links
if (links[i].host !== location.host)
continue;
var nav_path = paths(links[i].pathname);
var length = prefix_length(nav_path, cur_path);
if (length > max_length) {
max_length = length;
pos = i;
}
}
// Add class to parent <li>, and enclosing <li> if in dropdown
if (pos >= 0) {
var menu_anchor = $(links[pos]);
menu_anchor.parent().addClass("active");
menu_anchor.closest("li.dropdown").addClass("active");
}
});
function paths(pathname) {
var pieces = pathname.split("/");
pieces.shift(); // always starts with /
var end = pieces[pieces.length - 1];
if (end === "index.html" || end === "")
pieces.pop();
return(pieces);
}
// Returns -1 if not found
function prefix_length(needle, haystack) {
if (needle.length > haystack.length)
return(-1);
// Special case for length-0 haystack, since for loop won't run
if (haystack.length === 0) {
return(needle.length === 0 ? 0 : -1);
}
for (var i = 0; i < haystack.length; i++) {
if (needle[i] != haystack[i])
return(i);
}
return(haystack.length);
}
/* Clipboard --------------------------*/
function changeTooltipMessage(element, msg) {
var tooltipOriginalTitle=element.getAttribute('data-original-title');
element.setAttribute('data-original-title', msg);
$(element).tooltip('show');
element.setAttribute('data-original-title', tooltipOriginalTitle);
}
if(ClipboardJS.isSupported()) {
$(document).ready(function() {
var copyButton = "<button type='button' class='btn btn-primary btn-copy-ex' type = 'submit' title='Copy to clipboard' aria-label='Copy to clipboard' data-toggle='tooltip' data-placement='left auto' data-trigger='hover' data-clipboard-copy><i class='fa fa-copy'></i></button>";
$(".examples, div.sourceCode").addClass("hasCopyButton");
// Insert copy buttons:
$(copyButton).prependTo(".hasCopyButton");
// Initialize tooltips:
$('.btn-copy-ex').tooltip({container: 'body'});
// Initialize clipboard:
var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {
text: function(trigger) {
return trigger.parentNode.textContent;
}
});
clipboardBtnCopies.on('success', function(e) {
changeTooltipMessage(e.trigger, 'Copied!');
e.clearSelection();
});
clipboardBtnCopies.on('error', function() {
changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy');
});
});
}
})(window.jQuery || window.$)
================================================
FILE: docs/pkgdown.yml
================================================
pandoc: 1.19.2.1
pkgdown: 1.3.0
pkgdown_sha: ~
articles:
introducing-urbnmapr: introducing-urbnmapr.html
================================================
FILE: docs/reference/ccdf_labels.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Child Care and Development Fund labels data — ccdf_labels • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Child Care and Development Fund labels data — ccdf_labels" />
<meta property="og:description" content="Child Care and Development Fund labels data" />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Child Care and Development Fund labels data</h1>
<small class="dont-index">Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/R/ccdf_labels.R'><code>R/ccdf_labels.R</code></a></small>
<div class="hidden name"><code>ccdf_labels.Rd</code></div>
</div>
<div class="ref-description">
<p>Child Care and Development Fund labels data</p>
</div>
<pre class="usage"><span class='no'>ccdf_labels</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>Data frame with columns</p><dl class='dl-horizontal'>
<dt>long, lat</dt><dd><p>Longitude and latitude</p></dd>
<dt>state_name, state_abbv</dt><dd><p>State name and state abbreviation</p></dd>
</dl>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#format">Format</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/counties.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>County shapefile data — counties • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="County shapefile data — counties" />
<meta property="og:description" content="County shapefile data, cleaned and parsed into a tibble for easy mapping.
Includes various state identifiers for easy merging." />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>County shapefile data</h1>
<small class="dont-index">Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/R/counties.R'><code>R/counties.R</code></a></small>
<div class="hidden name"><code>counties.Rd</code></div>
</div>
<div class="ref-description">
<p>County shapefile data, cleaned and parsed into a tibble for easy mapping.
Includes various state identifiers for easy merging.</p>
</div>
<pre class="usage"><span class='no'>counties</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>Data frame with columns</p><dl class='dl-horizontal'>
<dt>long, lat</dt><dd><p>Longitude and latitude</p></dd>
<dt>county_name, county_fips, fips_class</dt><dd><p>County name, five-digit FIPS and FIPS class code</p></dd>
<dt>state_name, state_abbv, state_fips</dt><dd><p>State name, postal abbreviation, and two-digit FIPS code</p></dd>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>United States Census Bureau,
<a href='https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html'>https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html</a></p>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#format">Format</a></li>
<li><a href="#source">Source</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/counties_labels.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>County labels data — counties_labels • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="County labels data — counties_labels" />
<meta property="og:description" content="Includes various state identifiers for easy merging." />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>County labels data</h1>
<small class="dont-index">Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/R/counties_labels.R'><code>R/counties_labels.R</code></a></small>
<div class="hidden name"><code>counties_labels.Rd</code></div>
</div>
<div class="ref-description">
<p>Includes various state identifiers for easy merging.</p>
</div>
<pre class="usage"><span class='no'>counties_labels</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>Data frame with columns</p><dl class='dl-horizontal'>
<dt>long, lat</dt><dd><p>Longitude and latitude</p></dd>
<dt>county_name, county_fips, fips_class</dt><dd><p>County name, five-digit FIPS and FIPS class code</p></dd>
<dt>state_name, state_abbv, state_fips</dt><dd><p>State name, postal abbreviation, and two-digit FIPS code</p></dd>
</dl>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#format">Format</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/countydata.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>County data for mapping — countydata • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="County data for mapping — countydata" />
<meta property="og:description" content="County-level data to use for example maps.
Includes county FIPS code to match with county shapefile data." />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>County data for mapping</h1>
<small class="dont-index">Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/R/countydata.R'><code>R/countydata.R</code></a></small>
<div class="hidden name"><code>countydata.Rd</code></div>
</div>
<div class="ref-description">
<p>County-level data to use for example maps.
Includes county FIPS code to match with county shapefile data.</p>
</div>
<pre class="usage"><span class='no'>countydata</span></pre>
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>Data frame with columns</p><dl class='dl-horizontal'>
<dt>year</dt><dd><p>Year of data</p></dd>
<dt>county_fips</dt><dd><p>Five-digit FIPS code</p></dd>
<dt>hhhpop</dt><dd><p>Household population</p></dd>
<dt>horate</dt><dd><p>Homeownership rate</p></dd>
<dt>medhhincome</dt><dd><p>Median household income</p></dd>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>Urban Institute Sloan ADRF Database,
<a href='https://adrf.urban.org'>https://adrf.urban.org</a></p>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#format">Format</a></li>
<li><a href="#source">Source</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/get_urbn_labels.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Import different map labels. — get_urbn_labels • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Import different map labels. — get_urbn_labels" />
<meta property="og:description" content="get_urbn_labels() loads labels and coordinates for maps from the get_urbn_map() functions.
Note: there are currently only sf options for states and territories_states, as
these are the only options that have custom labels. To label counties and territories_counties,
use geom_sf_text() or geom_sf_label()." />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Import different map labels.</h1>
<small class="dont-index">Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/R/get_urbn_labels.R'><code>R/get_urbn_labels.R</code></a></small>
<div class="hidden name"><code>get_urbn_labels.Rd</code></div>
</div>
<div class="ref-description">
<p><code>get_urbn_labels()</code> loads labels and coordinates for maps from the <code><a href='get_urbn_map.html'>get_urbn_map()</a></code> functions.
Note: there are currently only <code>sf</code> options for <code>states</code> and <code>territories_states</code>, as
these are the only options that have custom labels. To label <code>counties</code> and <code>territories_counties</code>,
use <code>geom_sf_text()</code> or <code>geom_sf_label()</code>.</p>
</div>
<pre class="usage"><span class='fu'>get_urbn_labels</span>(<span class='kw'>map</span> <span class='kw'>=</span> <span class='st'>"states"</span>, <span class='kw'>sf</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>map</th>
<td><p>Selection of custom labels. Current options are <code>"states"</code>, <code>"counties"</code>, <code>"ccdf"</code>, <code>"territories"</code>, and <code>"territories_counties"</code>.</p></td>
</tr>
<tr>
<th>sf</th>
<td><p>Option indicates whether data is loaded as a <code>tibble()</code> or an <code>sf</code> object</p></td>
</tr>
</table>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#arguments">Arguments</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/get_urbn_map.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Import different maps — get_urbn_map • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Import different maps — get_urbn_map" />
<meta property="og:description" content="get_urbn_map() loads maps that are different than states and counties" />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Import different maps</h1>
<small class="dont-index">Source: <a href='https://github.com/UrbanInstitute/urbnmapr/blob/master/R/get_urbn_map.R'><code>R/get_urbn_map.R</code></a></small>
<div class="hidden name"><code>get_urbn_map.Rd</code></div>
</div>
<div class="ref-description">
<p><code>get_urbn_map()</code> loads maps that are different than <code>states</code> and <code>counties</code></p>
</div>
<pre class="usage"><span class='fu'>get_urbn_map</span>(<span class='kw'>map</span> <span class='kw'>=</span> <span class='st'>"states"</span>, <span class='kw'>sf</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>map</th>
<td><p>Selection of custom map. Current options are <code>"states"</code>, <code>"counties"</code>, <code>"ccdf"</code>, <code>"territories_states"</code>, and <code>"territories_counties"</code>.</p></td>
</tr>
<tr>
<th>sf</th>
<td><p>Option indicates whether data is loaded as a <code>tibble()</code> or an <code>sf</code> object</p></td>
</tr>
</table>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#arguments">Arguments</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/index.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Function reference • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Function reference" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-index">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">urbnmapr</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.0.9002</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/introducing-urbnmapr.html">Introducing urbnmapr</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/UrbanInstitute/urbnmapr">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Reference</h1>
</div>
<table class="ref-index">
<colgroup>
<col class="alias" />
<col class="title" />
</colgroup>
<tbody>
<tr>
<th colspan="2">
<h2 id="section-all-functions" class="hasAnchor"><a href="#section-all-functions" class="anchor"></a>All functions</h2>
<p class="section-desc"></p>
</th>
</tr>
<tr>
<td>
<p><code><a href="ccdf_labels.html">ccdf_labels</a></code> </p>
</td>
<td><p>Child Care and Development Fund labels data</p></td>
</tr><tr>
<td>
<p><code><a href="counties.html">counties</a></code> </p>
</td>
<td><p>County shapefile data</p></td>
</tr><tr>
<td>
<p><code><a href="counties_labels.html">counties_labels</a></code> </p>
</td>
<td><p>County labels data</p></td>
</tr><tr>
<td>
<p><code><a href="countydata.html">countydata</a></code> </p>
</td>
<td><p>County data for mapping</p></td>
</tr><tr>
<td>
<p><code><a href="get_urbn_labels.html">get_urbn_labels()</a></code> </p>
</td>
<td><p>Import different map labels.</p></td>
</tr><tr>
<td>
<p><code><a href="get_urbn_map.html">get_urbn_map()</a></code> </p>
</td>
<td><p>Import different maps</p></td>
</tr><tr>
<td>
<p><code><a href="statedata.html">statedata</a></code> </p>
</td>
<td><p>State data for mapping</p></td>
</tr><tr>
<td>
<p><code><a href="states.html">states</a></code> </p>
</td>
<td><p>State shapefile data</p></td>
</tr><tr>
<td>
<p><code><a href="states_labels.html">states_labels</a></code> </p>
</td>
<td><p>States labels data</p></td>
</tr><tr>
<td>
<p><code><a href="territories_counties.html">territories_counties</a></code> </p>
</td>
<td><p>County shapefile data with U.S. territories</p></td>
</tr><tr>
<td>
<p><code><a href="territories_labels.html">territories_labels</a></code> </p>
</td>
<td><p>Territories labels data</p></td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#section-all-functions">All functions</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Sarah Strochak, Kyle Ueyama, Aaron Williams.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
</body>
</html>
================================================
FILE: docs/reference/statedata.html
================================================
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>State data for mapping — statedata • urbnmapr</title>
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax
gitextract_haf2t6ds/
├── .Rbuildignore
├── .gitignore
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── DESCRIPTION
├── NAMESPACE
├── NEWS.md
├── R/
│ ├── ccdf_labels.R
│ ├── counties.R
│ ├── counties_labels.R
│ ├── countydata.R
│ ├── get_urbn_labels.R
│ ├── get_urbn_map.R
│ ├── statedata.R
│ ├── states.R
│ ├── states_labels.R
│ ├── sysdata.rda
│ ├── territories_counties.R
│ └── territories_labels.R
├── README.Rmd
├── README.md
├── data/
│ ├── counties.rda
│ ├── countydata.rda
│ ├── statedata.rda
│ └── states.rda
├── data-raw/
│ ├── ccdf.R
│ ├── ccdf_labels.R
│ ├── counties.R
│ ├── counties_labels.R
│ ├── counties_sf.R
│ ├── countydata.R
│ ├── generate_sysdata.R
│ ├── statedata.R
│ ├── states.R
│ ├── states_labels.R
│ ├── states_sf.R
│ ├── territories.R
│ ├── territories_counties.R
│ ├── territories_counties_sf.R
│ ├── territories_labels.R
│ ├── territories_sf.R
│ └── utils.R
├── docs/
│ ├── CODE_OF_CONDUCT.html
│ ├── articles/
│ │ ├── index.html
│ │ ├── introducing-urbnmapr.html
│ │ └── start-to-finish.html
│ ├── authors.html
│ ├── docsearch.css
│ ├── docsearch.js
│ ├── index.html
│ ├── news/
│ │ └── index.html
│ ├── pkgdown.css
│ ├── pkgdown.js
│ ├── pkgdown.yml
│ └── reference/
│ ├── ccdf_labels.html
│ ├── counties.html
│ ├── counties_labels.html
│ ├── countydata.html
│ ├── get_urbn_labels.html
│ ├── get_urbn_map.html
│ ├── index.html
│ ├── statedata.html
│ ├── states.html
│ ├── states_labels.html
│ ├── territories_counties.html
│ └── territories_labels.html
├── hexsticker.R
├── man/
│ ├── ccdf_labels.Rd
│ ├── counties.Rd
│ ├── counties_labels.Rd
│ ├── countydata.Rd
│ ├── get_urbn_labels.Rd
│ ├── get_urbn_map.Rd
│ ├── statedata.Rd
│ ├── states.Rd
│ ├── states_labels.Rd
│ ├── territories_counties.Rd
│ └── territories_labels.Rd
├── urbnmapr.Rproj
└── vignettes/
└── introducing-urbnmapr.Rmd
SYMBOL INDEX (5 symbols across 2 files)
FILE: docs/docsearch.js
function matchedWords (line 54) | function matchedWords(hit) {
function updateHitURL (line 73) | function updateHitURL(hit) {
FILE: docs/pkgdown.js
function paths (line 49) | function paths(pathname) {
function prefix_length (line 60) | function prefix_length(needle, haystack) {
function changeTooltipMessage (line 79) | function changeTooltipMessage(element, msg) {
Condensed preview — 80 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (253K chars).
[
{
"path": ".Rbuildignore",
"chars": 167,
"preview": "^.*\\.Rproj$\n^\\.Rproj\\.user$\n^data-raw$\n^README\\.Rmd$\n^README-.*\\.png$\n^README_files$\n^\\.travis\\.yml$\n^docs$\n^CODE_OF_CON"
},
{
"path": ".gitignore",
"chars": 49,
"preview": ".Rproj.user\n.Rhistory\n.RData\n.Ruserdata\ninst/doc\n"
},
{
"path": ".travis.yml",
"chars": 257,
"preview": "# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r\n\nlanguage: R\nsudo: true\ndist: xenial\nca"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 1407,
"preview": "# Contributor Code of Conduct\n\nAs contributors and maintainers of this project, we pledge to respect all people who cont"
},
{
"path": "DESCRIPTION",
"chars": 1408,
"preview": "Package: urbnmapr\nType: Package\nTitle: State and county shapefiles in sf and tibble format\nVersion: 0.0.0.9002\nAuthors@R"
},
{
"path": "NAMESPACE",
"chars": 117,
"preview": "# Generated by roxygen2: do not edit by hand\n\nexport(get_urbn_labels)\nexport(get_urbn_map)\nimportFrom(tibble,tibble)\n"
},
{
"path": "NEWS.md",
"chars": 743,
"preview": "## urbnmapr 0.0.0.9002\n\n* Adds `SF` option to `get_urbn_map()` and `get_urbn_label()`\n* Add [pkgdown](https://github.com"
},
{
"path": "R/ccdf_labels.R",
"chars": 268,
"preview": "#' Child Care and Development Fund labels data\n#'\n#'\n#' @format Data frame with columns\n#' \\describe{\n#' \\item{long, lat"
},
{
"path": "R/counties.R",
"chars": 628,
"preview": "#' County shapefile data\n#'\n#' County shapefile data, cleaned and parsed into a tibble for easy mapping.\n#' Includes var"
},
{
"path": "R/counties_labels.R",
"chars": 435,
"preview": "#' County labels data\n#'\n#' Includes various state identifiers for easy merging.\n#'\n#' @format Data frame with columns\n#"
},
{
"path": "R/countydata.R",
"chars": 527,
"preview": "#' County data for mapping\n#'\n#' County-level data to use for example maps.\n#' Includes county FIPS code to match with c"
},
{
"path": "R/get_urbn_labels.R",
"chars": 1671,
"preview": "#' Import different map labels.\n#'\n#' `get_urbn_labels()` loads labels and coordinates for maps from the `get_urbn_map()"
},
{
"path": "R/get_urbn_map.R",
"chars": 2205,
"preview": "#' Import different maps\n#'\n#' `get_urbn_map()` loads maps that are different than `states` and `counties`\n#'\n#' @param "
},
{
"path": "R/statedata.R",
"chars": 547,
"preview": "#' State data for mapping\n#'\n#' State-level data to use for example maps.\n#' Includes state FIPS code to match with stat"
},
{
"path": "R/states.R",
"chars": 527,
"preview": "#' State shapefile data\n#'\n#' State shapefile data, cleaned and parsed into a tibble for easy mapping.\n#' Includes vario"
},
{
"path": "R/states_labels.R",
"chars": 267,
"preview": "#' States labels data\n#'\n#' States labels data\n#'\n#' @format Data frame with columns\n#' \\describe{\n#' \\item{long, lat}{L"
},
{
"path": "R/territories_counties.R",
"chars": 679,
"preview": "#' County shapefile data with U.S. territories\n#'\n#' County shapefile data with territories, cleaned and parsed into a t"
},
{
"path": "R/territories_labels.R",
"chars": 282,
"preview": "#' Territories labels data\n#'\n#' Territories labels data\n#'\n#' @format Data frame with columns\n#' \\describe{\n#' \\item{lo"
},
{
"path": "README.Rmd",
"chars": 6205,
"preview": "---\noutput: github_document\n---\n\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n# urbnmapr <a h"
},
{
"path": "README.md",
"chars": 6617,
"preview": "\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n# urbnmapr <a href=\"https://urbaninstitute.gith"
},
{
"path": "data-raw/ccdf.R",
"chars": 567,
"preview": "# American Samoa needs multiple transformations. The transformation are simpler\n# with the county data. get American Sam"
},
{
"path": "data-raw/ccdf_labels.R",
"chars": 1863,
"preview": "# labels for ccdf map\n# to be called only by generate_sysdata.R for internal package use\n\nccdf_labels <- readr::read_csv"
},
{
"path": "data-raw/counties.R",
"chars": 424,
"preview": "# load utility functions\nsource('data-raw/utils.R')\n\n# get state shapefile, tidy, add fips data\ncounties <- get_shapefil"
},
{
"path": "data-raw/counties_labels.R",
"chars": 294,
"preview": "# generate counties labels\n# to be called only by generate_sysdata.R for internal package use\n\nlibrary(dplyr)\n\ncounties_"
},
{
"path": "data-raw/counties_sf.R",
"chars": 433,
"preview": "# get county shapefile, convert to SF, add fips data, filter out territories\ncounties_sf <- get_shapefile(2016, 'county'"
},
{
"path": "data-raw/countydata.R",
"chars": 1141,
"preview": "library(tidyverse)\n\n# read county level household variables from Sloan database\ntemp <- tempfile(fileext = '.zip')\ndownl"
},
{
"path": "data-raw/generate_sysdata.R",
"chars": 831,
"preview": "# source & save various data creation files for internal sysdata.rda\nsource('data-raw/utils.R')\nsource('data-raw/states_"
},
{
"path": "data-raw/statedata.R",
"chars": 871,
"preview": "library(tidyverse)\n\n# read county level household variables from Sloan database\ntemp <- tempfile(fileext = '.zip')\ndownl"
},
{
"path": "data-raw/states.R",
"chars": 416,
"preview": "# load utility functions\nsource('data-raw/utils.R')\n\n# get state shapefile, tidy, add fips data\nstates <- get_shapefile("
},
{
"path": "data-raw/states_labels.R",
"chars": 2024,
"preview": "# states labels\n# to be called only by generate_sysdata.R for internal package use\n\nstates_labels <- readr::read_csv(\n\"s"
},
{
"path": "data-raw/states_sf.R",
"chars": 358,
"preview": "# get state shapefile, convert to SF, add fips data\nstates_sf <- get_shapefile(2016, 'state', '5m') %>%\n sf::st_as_sf()"
},
{
"path": "data-raw/territories.R",
"chars": 963,
"preview": "# American Samoa needs multiple transformations. The transformation are simpler\n# with the county data. get American Sam"
},
{
"path": "data-raw/territories_counties.R",
"chars": 310,
"preview": "# get state shapefile, tidy, add fips data\nterritories_counties <- get_shapefile(2016, 'county', '5m') %>%\n tidy(region"
},
{
"path": "data-raw/territories_counties_sf.R",
"chars": 432,
"preview": "# get county shapefile, convert to SF, add fips data\nterritories_counties_sf <- get_shapefile(2016, 'county', '5m') %>%\n"
},
{
"path": "data-raw/territories_labels.R",
"chars": 1139,
"preview": "# territories lables\n# to be called only by generate_sysdata.R for internal package use\n\nterritories_labels <- readr::re"
},
{
"path": "data-raw/territories_sf.R",
"chars": 1078,
"preview": "# American Samoa needs multiple transformations. The transformation are simpler\n# with the county data. get American Sam"
},
{
"path": "data-raw/utils.R",
"chars": 11822,
"preview": "### helper functions for parsing shapefile data --------------------------------\n\n# load necessary libraries -----------"
},
{
"path": "docs/CODE_OF_CONDUCT.html",
"chars": 6091,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/articles/index.html",
"chars": 4667,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/articles/introducing-urbnmapr.html",
"chars": 21991,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type"
},
{
"path": "docs/articles/start-to-finish.html",
"chars": 8927,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html>\n<head>\n<meta http-equiv=\"Content-Type\" content="
},
{
"path": "docs/authors.html",
"chars": 5222,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/docsearch.css",
"chars": 11758,
"preview": "/* Docsearch -------------------------------------------------------------- */\n/*\n Source: https://github.com/algolia/d"
},
{
"path": "docs/docsearch.js",
"chars": 2018,
"preview": "$(function() {\n\n // register a handler to move the focus to the search bar\n // upon pressing shift + \"/\" (i.e. \"?\")\n "
},
{
"path": "docs/index.html",
"chars": 24011,
"preview": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type"
},
{
"path": "docs/news/index.html",
"chars": 6416,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/pkgdown.css",
"chars": 4130,
"preview": "/* Sticky footer */\n\n/**\n * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/\n * Details"
},
{
"path": "docs/pkgdown.js",
"chars": 3379,
"preview": "/* http://gregfranko.com/blog/jquery-best-practices/ */\n(function($) {\n $(function() {\n\n $(\"#sidebar\")\n .stick_"
},
{
"path": "docs/pkgdown.yml",
"chars": 108,
"preview": "pandoc: 1.19.2.1\npkgdown: 1.3.0\npkgdown_sha: ~\narticles:\n introducing-urbnmapr: introducing-urbnmapr.html\n\n"
},
{
"path": "docs/reference/ccdf_labels.html",
"chars": 5640,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/counties.html",
"chars": 6194,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/counties_labels.html",
"chars": 5752,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/countydata.html",
"chars": 6068,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/get_urbn_labels.html",
"chars": 6782,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/get_urbn_map.html",
"chars": 6165,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/index.html",
"chars": 7074,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/statedata.html",
"chars": 6078,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/states.html",
"chars": 6067,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/states_labels.html",
"chars": 5527,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/territories_counties.html",
"chars": 6366,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "docs/reference/territories_labels.html",
"chars": 5582,
"preview": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n<m"
},
{
"path": "hexsticker.R",
"chars": 812,
"preview": "library(tidyverse)\nlibrary(urbnmapr)\nlibrary(urbnthemes)\nlibrary(hexSticker)\n\nset_urbn_defaults(\"map\")\n\nurbnmapr1 <- sta"
},
{
"path": "man/ccdf_labels.Rd",
"chars": 451,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ccdf_labels.R\n\\docType{data}\n\\name{ccdf_la"
},
{
"path": "man/counties.Rd",
"chars": 743,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/counties.R\n\\docType{data}\n\\name{counties}\n"
},
{
"path": "man/counties_labels.Rd",
"chars": 580,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/counties_labels.R\n\\docType{data}\n\\name{cou"
},
{
"path": "man/countydata.Rd",
"chars": 642,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/countydata.R\n\\docType{data}\n\\name{countyda"
},
{
"path": "man/get_urbn_labels.Rd",
"chars": 897,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/get_urbn_labels.R\n\\name{get_urbn_labels}\n\\"
},
{
"path": "man/get_urbn_map.Rd",
"chars": 604,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/get_urbn_map.R\n\\name{get_urbn_map}\n\\alias{"
},
{
"path": "man/statedata.Rd",
"chars": 659,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/statedata.R\n\\docType{data}\n\\name{statedata"
},
{
"path": "man/states.Rd",
"chars": 639,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/states.R\n\\docType{data}\n\\name{states}\n\\ali"
},
{
"path": "man/states_labels.Rd",
"chars": 409,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/states_labels.R\n\\docType{data}\n\\name{state"
},
{
"path": "man/territories_counties.Rd",
"chars": 830,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/territories_counties.R\n\\docType{data}\n\\nam"
},
{
"path": "man/territories_labels.Rd",
"chars": 439,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/territories_labels.R\n\\docType{data}\n\\name{"
},
{
"path": "urbnmapr.Rproj",
"chars": 356,
"preview": "Version: 1.0\n\nRestoreWorkspace: Default\nSaveWorkspace: Default\nAlwaysSaveHistory: Default\n\nEnableCodeIndexing: Yes\nUseSp"
},
{
"path": "vignettes/introducing-urbnmapr.Rmd",
"chars": 5496,
"preview": "---\ntitle: \"Introducing urbnmapr\"\nauthor: \"Vignette Author\"\ndate: \"`r Sys.Date()`\"\noutput: rmarkdown::html_vignette\nvign"
}
]
// ... and 5 more files (download for full content)
About this extraction
This page contains the full source code of the UrbanInstitute/urbnmapr GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 80 files (230.0 KB), approximately 75.1k tokens, and a symbol index with 5 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.