plot_county: Make a county chloropleth for all metrics

Description Usage Arguments See Also Examples

View source: R/visualize.R

Description

Intended to be run on the output of join_county_map (the "county" element specifically). Returns a list with one element per value of the dat$metric variable.

Usage

1

Arguments

dat

a dashboard table where segment == "County" that has a "geometry" column (e.g., produced from join_county_map)

See Also

Other functions to run dashboard visualization: get_county_map(), int_breaks(), join_county_map(), plot_bar(), 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
## 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)

x <- filter(dash_list$county, group == "all_sports", quarter == 4)
p <- plot_county(x)
p$churn
gridExtra::grid.arrange(grobs = p)

# interactive with plotly
plotly::ggplotly(p$churn)
plotly::subplot(p, nrows = 2) %>% plotly::hide_colorbar()

## End(Not run)

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