Learn R Programming

stlcsb (version 0.1.2)

csb_filter: Subset Based on Call Categories

Description

csb_filter returns observations that match any combination of the predefined categories that are created

Usage

csb_filter(.data, var, category)

Arguments

.data

A tibble or data frame

var

name of the column containing original problem code data

category

a vector with the unquoted name(s) of the category(s) for the function to return. You can also explicitly state quoted problemcode(s). Valid categories are: admin, animal, construction, debris, degrade, disturbance, event, health, landscape, law, maintenance, nature, road, sewer, traffic, vacant, and waste. If categories are listed, each should be preceded by 'cat_'.

Value

csb_filter returns data with an additional variable for an intelligible category for CSB requests.

Examples

Run this code
# NOT RUN {
csb_filter(january_2018, var = problemcode, category = cat_vacant)
csb_filter(january_2018, var = problemcode, category = c(cat_waste, cat_debris))
csb_filter(january_2018, var = problemcode, category = "WTR-COMING-UP")

# }

Run the code above in your browser using DataLab