Data downloaded from the St. Louis Metropolitan Police Department are downloaded with incorrect file paths - e.g. January2008.CSV.html. This function iterates over all files in a given path and replaces their file extensions. Thus January2008.CSV.html will be replaced by january2008.csv. There should be no more than 12 files in a given path, and all should correspond to the same year.

cs_prep_year(path, verbose = FALSE)

Arguments

path

File path where raw STLMPD data are

verbose

If TRUE, returns a tibble with results; otherwise if FALSE, no output is returned.

Value

A tibble containing old file names and new file names for reference is verbose = TRUE. Otherwise, no output is returned. This function will change all problematic filenames in the specified path.

Examples

# NOT RUN {
cs_prep_year(path = "data/raw/2008")
# }