cs_extract_month: Extract Month from Year List Object

Description Usage Arguments Value See Also Examples

View source: R/month_tools.R

Description

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.

Usage

1
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

cs_replace_month

Examples

1
2
3
4
5
6
# 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")

compstatr documentation built on July 8, 2020, 7:34 p.m.