match.count: Count persons in households matching a list of conditions.

Description Usage Arguments Value Examples

View source: R/match.count.R

Description

Counts the rows in the population table, grouped by household, that match a list of conditions given as the ... argument, filling NA values with 0. The result can be joined to the housing data on SERIALNO, and the housing weights (called WGTP) should be used to compute estimates.

Usage

1
match.count(house, pop, ...)

Arguments

house

ACS housing data or subset with the SERIALNO field

pop

ACS population data or subset with the SERIALNO field

...

a list of conditions that define the subset, as bare expressions, not as strings

Value

vector of counts of people matching (...) conditions, should be aligned with house

Examples

1
2
3
# ESR is employment status; levels 1, 2, 4, and 5 are the employed levels
wa.house16$num.work <- match.count(wa.house16, wa.pop16, ESR %in% c(1,2,4,5))
group.count(wa.house16, 'num.work')

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