clean_police_outcomes.Rd
Cleans police outcomes to specification for model input. Police outcomes data is used in the calculation of weights and proven offences.
clean_police_outcomes(police_outcomes)
police_outcomes | tidy police outcomes data as would be produced by
|
---|
clean_police_outcomes()
will return a tidy dataframe as
specified in tidy_police_outcomes
except financial_year
will be replaced with date column year_ending
.
Cleaning police outcomes open data follows the following pattern.
Change numerical columns to numeric type
Map offence groups to standard names
Change financial years to year ending, year ending is 'attributed to the 1st of March for sake of convenience
Offence code "1/4.1/4.10/4.2" is split into four separate offence codes to map with police recorded crime
We expect this function to change as other data quality/relevance issues are identified in the police outcomes open data.