cs_get_data: Download Crime Data from SLMPD

Description Usage Arguments Value Examples

View source: R/get.R

Description

Downloads crime data from the SLMPD website.

Usage

1
cs_get_data(year, month, index)

Arguments

year

A year value in the style YYYY

month

Optional; a month number, name, or abbreviation - 1, "Jan", and "January" are all acceptible inputs.

index

Optional; an index object created with cs_create_index. Building the index prior to downloading data, especially if you are downloading multiple years worth of data, will result in dramatically faster execution times for this function.

Value

A year-list object ready for validation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create index
i <- cs_create_index()

# download single month
may18 <- cs_get_data(year = 2018, month = "May", index = i)

# preview single month
may18

# download full year
yearList18 <- cs_get_data(year = 2018, index = i)

# preview year list object
yearList18

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