Learn R Programming

censable (version 0.0.5)

collapse4: Collapse Full Race Categories into 4 Categories

Description

Collapses Other, AIAN, Asian, NHPI, and Two+ into other, by prefix.

Usage

collapse4(.data, prefix)

Value

.data with columns collapsed

Arguments

.data

tibble, data.frame, or sf tibble

prefix

The prefix(es) for the race categories. Must be a character vector.

Examples

Run this code
data(mt_county)
mt_county <- mt_county %>% collapse4(prefix = c('pop_', 'vap_'))

Run the code above in your browser using DataLab