This function extracts a given month from a list containing 12 tibbles - one per month - for additional data cleaning prior to collapsing the list. Since months are ordered alphabetically in the year list objects, this function makes the process of extracting a particular month more intuitive.

cs_extract_month(.data, month)

Arguments

.data

A list containing monthly crime data

month

A string name or abbreviation of a month, or its numeric value. Acceptable inputs include, for example, "January", "january", "Jan", "jan", and 1.

Value

A tibble containing a single month worth of crime data.

See also

Examples

# load example year-list object load(system.file("testdata", "yearList17.rda", package = "compstatr", mustWork = TRUE)) # extract May may17 <- cs_extract_month(yearList17, month = 5) may17 <- cs_extract_month(yearList17, month = "May")