Learn R Programming

compstatr (version 0.2.1)

cs_get_data: Download Crime Data from SLMPD

Description

Downloads crime data from the SLMPD website.

Usage

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

Run this code
# NOT RUN {
# 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
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab