acs.barchart: Make barchart from ACS PUMS data.

Description Usage Arguments Value Examples

View source: R/acs.barchart.R

Description

Make a barchart of weighted counts within categories from the ACS PUMS data. Optionally, this can be a stacked barchart, partitioned over two variables.

Usage

1
2
acs.barchart(data, x, stack = NULL, title = NULL, xlab = NULL,
  ylab = NULL)

Arguments

data

ACS PUMS data for housing or population

x

(string) name of categorical variable in data to put on x-axis

stack

optional (string) name of categorical value for stacked bar chart

title

optional plot title

xlab

optional x label

ylab

optional y label

Value

ggplot of weighted count data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
wa.house16$Tenure <- own.rent(wa.house16)
acs.barchart(wa.house16, 'Tenure',
             title='Housing Unit Count by Tenure', xlab='Tenure')

wa.pop16$sex <- acs.recode(wa.pop16, 'SEX', data.dict16)
wa.pop16$emp.stat <- acs.translate(wa.pop16, 'ESR', c(NA, 1:6),
    c('NILF', 'Employed', 'Employed', 'Unemployed', 'Employed', 'Employed', 'NILF'))
acs.barchart(wa.pop16, 'emp.stat', stack='sex',
             title='Employment Status by Gender',
             xlab='Employment Status')

davidthaler/PUMSutils documentation built on July 13, 2019, 9:58 a.m.