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)

Arguments

police_outcomes

tidy police outcomes data as would be produced by tidy_police_outcomes

Value

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.

Details

Cleaning police outcomes open data follows the following pattern.

  1. Change numerical columns to numeric type

  2. Map offence groups to standard names

  3. Change financial years to year ending, year ending is 'attributed to the 1st of March for sake of convenience

  4. 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.