shiny_choro: Start a Shiny Application for Choropleths

Description Usage Arguments Details Examples

Description

This function takes a dataframe and generates a local Shiny application for visualizing the results in a choropleth.

Usage

1
2
3
shiny_choro(df, fill, categories = NULL, map = c("county", "state",
  "world"), palette = "Blues", background = c("Base", "Greyscale",
  "Physical", "None"), cuts = NULL, dir = NULL)

Arguments

df

The dataframe with column fips (the FIPS code of the counties or states to show), with a column for the data to show, and a column for the grouping variable (if specifying categories)

fill

The name of the variable to show in the choropleth

categories

The name of the (optional) grouping variable on which to divide the data

map

The level at which to draw the map. Options are county, state, and world

palette

An RColorBrewer palette to use. Default is Blues

background

One of Base, Greyscale, Physical, or None, to have as the background tiles for the map

cuts

An optional vector specifying where to make the color breaks. Default cuts are the 20th, 40th, 60th, and 80th percentiles

dir

The directory in which to create the Shiny app. Defaults to tempdir

Details

NOTE: The leaflet R package must be installed.

Examples

1
2
3
data(population_age, package = "noncensus")
shiny_choro(population_age, fill = "population", categories = "age_group",
            map = "county", palette = "Purples", background = "Grey")

ramhiser/noncensus documentation built on May 26, 2019, 10:11 p.m.