Downloads crime data from the SLMPD website.

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

# \donttest{ # create index i <- cs_create_index() # download single month may18 <- cs_get_data(year = 2018, month = "May", index = i) # preview single month may18
#> # A tibble: 4,013 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-016789 2018-05 01/01/201… NA NA NA #> 2 18-016789 2018-05 01/01/201… NA NA NA #> 3 18-021847 2018-05 01/01/201… Y NA NA #> 4 18-023887 2018-05 01/01/201… Y NA NA #> 5 18-021714 2018-05 01/03/201… Y NA NA #> 6 18-020603 2018-05 01/05/201… Y NA NA #> 7 18-020522 2018-05 01/09/201… Y NA NA #> 8 18-001340 2018-05 01/09/201… Y NA NA #> 9 18-019842 2018-05 01/12/201… Y NA NA #> 10 16-001981 2018-05 01/13/201… NA NA NA #> # … with 4,003 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr>
# download full year yearList18 <- cs_get_data(year = 2018, index = i) # preview year list object yearList18
#> $December #> # A tibble: 3,672 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 17-061022 2018-12 01/01/201… NA NA NA #> 2 18-057786 2018-12 01/01/201… Y NA NA #> 3 18-059860 2018-12 01/01/201… Y NA NA #> 4 19-000484 2018-12 01/02/201… Y NA NA #> 5 18-051979 2018-12 01/15/201… Y NA NA #> 6 18-057324 2018-12 01/17/201… Y NA NA #> 7 18-060522 2018-12 01/18/200… Y NA NA #> 8 18-002847 2018-12 01/18/201… Y NA NA #> 9 18-057771 2018-12 02/09/200… Y NA NA #> 10 16-054199 2018-12 03/01/201… NA NA NA #> # … with 3,662 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $November #> # A tibble: 3,559 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-051559 2018-11 01/01/198… Y NA NA #> 2 18-051559 2018-11 01/01/198… Y NA NA #> 3 18-053358 2018-11 01/01/201… Y NA NA #> 4 18-053718 2018-11 01/01/201… Y NA NA #> 5 18-055007 2018-11 01/01/201… Y NA NA #> 6 18-052746 2018-11 01/01/201… Y NA NA #> 7 18-056376 2018-11 01/01/201… Y NA NA #> 8 18-050925 2018-11 01/01/201… Y NA NA #> 9 18-054053 2018-11 01/08/200… Y NA NA #> 10 18-056202 2018-11 01/09/201… Y NA NA #> # … with 3,549 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $October #> # A tibble: 4,087 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-048687 2018-10 01/01/199… Y NA NA #> 2 18-051538 2018-10 01/01/199… Y NA NA #> 3 18-049197 2018-10 01/01/201… Y NA NA #> 4 18-052108 2018-10 01/01/201… Y NA NA #> 5 18-045636 2018-10 01/01/201… Y NA NA #> 6 18-046720 2018-10 01/07/201… Y NA NA #> 7 18-050247 2018-10 01/08/199… Y NA NA #> 8 18-049185 2018-10 01/08/199… Y NA NA #> 9 18-047408 2018-10 01/16/201… Y NA NA #> 10 18-050409 2018-10 02/02/201… Y NA NA #> # … with 4,077 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $September #> # A tibble: 4,096 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-042811 2018-09 01/01/201… Y NA NA #> 2 18-041945 2018-09 01/01/201… Y NA NA #> 3 18-044360 2018-09 01/01/201… Y NA NA #> 4 18-041929 2018-09 01/10/201… Y NA NA #> 5 18-009453 2018-09 02/28/201… NA NA NA #> 6 18-041303 2018-09 02/28/201… Y NA NA #> 7 18-041492 2018-09 03/01/201… Y NA NA #> 8 18-042847 2018-09 03/03/201… Y NA NA #> 9 18-045239 2018-09 03/06/197… Y NA NA #> 10 18-046406 2018-09 03/10/201… Y NA NA #> # … with 4,086 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $August #> # A tibble: 4,402 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-039745 2018-08 01/01/201… Y NA NA #> 2 18-037186 2018-08 01/07/201… Y NA NA #> 3 18-040825 2018-08 01/10/201… Y NA NA #> 4 18-038219 2018-08 01/31/201… Y NA NA #> 5 18-040361 2018-08 02/01/201… Y NA NA #> 6 16-006584 2018-08 02/09/201… NA NA NA #> 7 18-033739 2018-08 02/23/201… Y NA NA #> 8 18-038746 2018-08 02/23/201… Y NA NA #> 9 18-041626 2018-08 02/23/201… Y NA NA #> 10 18-040809 2018-08 02/27/201… Y NA NA #> # … with 4,392 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $July #> # A tibble: 4,257 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-030787 2018-07 01/01/200… Y NA NA #> 2 18-030778 2018-07 01/01/201… Y NA NA #> 3 18-033335 2018-07 01/01/201… Y NA NA #> 4 18-033321 2018-07 01/01/201… Y NA NA #> 5 18-033370 2018-07 01/01/201… Y NA NA #> 6 18-034224 2018-07 01/01/201… Y NA NA #> 7 18-033933 2018-07 01/01/201… Y NA NA #> 8 18-035128 2018-07 01/11/201… Y NA NA #> 9 18-033082 2018-07 01/17/201… Y NA NA #> 10 18-029604 2018-07 01/21/201… Y NA NA #> # … with 4,247 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $June #> # A tibble: 4,282 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-026541 2018-06 01/01/190… Y NA NA #> 2 18-026981 2018-06 01/01/201… Y NA NA #> 3 18-026416 2018-06 01/01/201… Y NA NA #> 4 18-030437 2018-06 01/01/201… Y NA NA #> 5 18-027408 2018-06 01/01/201… Y NA NA #> 6 18-028781 2018-06 01/02/201… Y NA NA #> 7 18-026632 2018-06 01/09/201… Y NA NA #> 8 18-003383 2018-06 01/22/201… Y NA NA #> 9 18-024483 2018-06 01/24/201… Y NA NA #> 10 18-025291 2018-06 02/01/201… Y NA NA #> # … with 4,272 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $May #> # A tibble: 4,013 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-016789 2018-05 01/01/201… NA NA NA #> 2 18-016789 2018-05 01/01/201… NA NA NA #> 3 18-021847 2018-05 01/01/201… Y NA NA #> 4 18-023887 2018-05 01/01/201… Y NA NA #> 5 18-021714 2018-05 01/03/201… Y NA NA #> 6 18-020603 2018-05 01/05/201… Y NA NA #> 7 18-020522 2018-05 01/09/201… Y NA NA #> 8 18-001340 2018-05 01/09/201… Y NA NA #> 9 18-019842 2018-05 01/12/201… Y NA NA #> 10 16-001981 2018-05 01/13/201… NA NA NA #> # … with 4,003 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $April #> # A tibble: 3,735 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-016789 2018-04 01/01/201… Y NA NA #> 2 18-018797 2018-04 01/01/201… Y NA NA #> 3 18-017473 2018-04 01/01/201… Y NA NA #> 4 18-014919 2018-04 01/01/201… Y NA NA #> 5 18-017915 2018-04 01/01/201… Y NA NA #> 6 18-018273 2018-04 01/01/201… Y NA NA #> 7 18-017912 2018-04 01/02/201… Y NA NA #> 8 18-017908 2018-04 01/03/201… Y NA NA #> 9 18-017910 2018-04 01/03/201… Y NA NA #> 10 18-017906 2018-04 01/04/201… Y NA NA #> # … with 3,725 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $March #> # A tibble: 3,629 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-009431 2018-03 03/01/201… Y NA NA #> 2 18-009700 2018-03 03/01/201… Y NA NA #> 3 18-009971 2018-03 03/05/201… Y NA NA #> 4 18-010716 2018-03 03/09/201… Y NA NA #> 5 18-010716 2018-03 03/09/201… Y NA NA #> 6 18-010757 2018-03 03/10/201… Y NA NA #> 7 18-011972 2018-03 03/17/201… Y NA NA #> 8 18-012030 2018-03 03/17/201… Y NA NA #> 9 18-012080 2018-03 03/18/201… Y NA NA #> 10 18-012231 2018-03 03/19/201… Y NA NA #> # … with 3,619 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $February #> # A tibble: 3,185 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-008084 2018-02 01/01/199… Y NA NA #> 2 18-007453 2018-02 01/01/201… Y NA NA #> 3 18-006151 2018-02 01/01/201… Y NA NA #> 4 18-008373 2018-02 01/01/201… Y NA NA #> 5 18-007399 2018-02 01/01/201… Y NA NA #> 6 18-005729 2018-02 01/01/201… Y NA NA #> 7 18-007226 2018-02 01/01/201… Y NA NA #> 8 18-007096 2018-02 01/01/201… Y NA NA #> 9 18-008842 2018-02 01/01/201… Y NA NA #> 10 18-002353 2018-02 01/01/201… NA NA NA #> # … with 3,175 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #> #> $January #> # A tibble: 3,825 x 20 #> complaint coded_month date_occur flag_crime flag_unfounded flag_administra… #> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 18-001804 2018-01 01/01/201… Y NA NA #> 2 18-002209 2018-01 01/01/201… Y NA NA #> 3 18-000063 2018-01 01/01/201… Y NA NA #> 4 18-000018 2018-01 01/01/201… Y NA NA #> 5 18-000003 2018-01 01/01/201… Y NA NA #> 6 18-000132 2018-01 01/01/201… Y NA NA #> 7 18-000010 2018-01 01/01/201… Y NA NA #> 8 18-000010 2018-01 01/01/201… Y NA NA #> 9 18-003411 2018-01 01/01/201… Y NA NA #> 10 18-005259 2018-01 01/01/201… Y NA NA #> # … with 3,815 more rows, and 14 more variables: count <chr>, #> # flag_cleanup <chr>, crime <chr>, district <chr>, description <chr>, #> # ileads_address <chr>, ileads_street <chr>, neighborhood <chr>, #> # location_name <chr>, location_comment <chr>, cad_address <chr>, #> # cad_street <chr>, x_coord <chr>, y_coord <chr> #>
# }