join_county_map: Join dashboard with county spatial data

Description Usage Arguments See Also Examples

View source: R/visualize.R

Description

This takes the output of get_county_map and joins with dashboard data. The result is a list split by segment. The county_census table is used for linking on a more precise variable (county_fips as oppossed to county name).

Usage

1
join_county_map(dashboard, county_map, county_census)

Arguments

dashboard

summary dashboard data

county_map

data produced by get_county_map

county_census

county names by fips, to provide more precise joining between dashboard results and county_map shapefile

See Also

Other functions to run dashboard visualization: get_county_map(), int_breaks(), plot_bar(), plot_county(), plot_month(), plot_value2(), plotly_config(), run_visual_county(), ui_button_layout()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
library(dplyr)
data(dashboard)

county_map <- get_county_map("SC")
county_census <- load_counties(state = "SC")
dash_list <- join_county_map(dashboard, county_map, county_census)

# produce a warning by using the wrong state
county_map <- get_county_map("ME")
county_census <- load_counties(state = "ME")
dash_list <- join_county_map(dashboard, county_map, county_census)

# Maine and South Carolina actually share one county name
x <- filter(dash_list$county, group == "all_sports", quarter == 4)
plot_county(x) %>% gridExtra::grid.arrange(grobs = .)

## End(Not run)

southwick-associates/sadash documentation built on Jan. 6, 2022, 5:17 p.m.