cs_replace_month: Extract Month from Year-list Object

Description Usage Arguments Value See Also Examples

View source: R/month_tools.R

Description

This function replaces a single month worth of crime data that has previously been extracted from a year-list object.

Usage

1
cs_replace_month(.data, month, monthData)

Arguments

.data

A year list object

month

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

monthData

A tibble containing a single month worth of crime data.

Value

An updated year-list object.

See Also

cs_extract_month

Examples

1
2
3
4
5
6
7
8
9
# load example year-list object
load(system.file("testdata", "yearList17.rda", package = "compstatr", mustWork = TRUE))

# extract May
may17 <- cs_extract_month(yearList17, month = 5)

# replace
yearList17 <- cs_replace_month(yearList17, month = 5, monthData = may17)
yearList17 <- cs_replace_month(yearList17, month = "May", monthData = may17)

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