ff_acs_age: Filter for age rows in ACS data and rebin ages if needed

View source: R/cleaning.R

ff_acs_ageR Documentation

Filter for age rows in ACS data and rebin ages if needed

Description

This function filters ACS data for rows that include ages. It also has optional parameters to rebin age groups into custom age bins.

Usage

ff_acs_age(df, age_column, recode = F, recode_list = NULL)

Arguments

df

Dataframe of ACS data

age_column

Column name that contains age information

recode

Boolean value of whether to recode age bins

recode_list

A named list where name is old age bin and value is a string for the new age bin

Value

Dataframe that only contains the age rows

Examples

age_bins <- list(`16 to 26 year old` = "16 to 25",
                 `75 and over` = "over 75")
ff_acs_age(df, description, recode = T, recode_list = age_bins)


forsythfuture/FFtools documentation built on April 5, 2022, 10:02 p.m.