map_stats: Create a cloropleth map.

Description Usage Arguments Details Value Examples

View source: R/map_stats.R

Description

Plots a cloropleth map for the given stats.

Usage

1
map_stats(data, column, colour = 2, label = "none")

Arguments

data

Data frame, must contain 2 columns, state_id & the stat to use. Currently there are two data sets can be used here, women_population_data.csv & median_income_by_state.csv

column

Character, specifies the stat to use, should match a column present in data

colour

Numeric, ranges from 1 to 7, defaults to 2, the classic Nadine west pink.

label

Character, 'dollar' if the stat is a currency, 'percent' if it is proportion, 'none' otherwise.

Details

This function plots summarised data by states in the us map.

*Note: It doesn't include states outside the us main land (Hawaii, PR and alaska)

Value

A cloropleth map of the U.S with the given stat.

Examples

1
2
3
income <- read.csv('/Data/Auxiliary_data/median_income_by_state.csv')
map_stats(income, "median_income", 4, "dollar")
map_stats(income, "median_income")

shahreyar-abeer/nadinewestr documentation built on May 27, 2019, 1:06 a.m.