tidy_police_outcomes.Rd
Tidies police outcomes, as given by load_police_outcomes
, to a
tidy data format, specified below.
tidy_police_outcomes(police_outcomes)
police_outcomes | A dataframe containing the police outcomes open data. |
---|
Returns a dataframe with columns
financial_year | The financial year to which the data refers. |
financial_quarter | The financial quarter (Q1 starting April) to which the data refers. |
force_name | The police force from which the data is acquired. |
offence | The name of the offence in HO format (same as ONS format). |
offence_group | The name of the offence group (does not include summary or other). |
offence_subgroup | The name of the offence subgroup. |
offence_code | The categorical code used in HO and ONS publications for offences. |
offence_code_expired | Indicates whether offence_code is still in use, character column. |
outcome | Name of police outcome at lowest level. |
outcome_group | Name of police outcome group. |
outcome_code | Categorical code of police outcome. |
number_offences | Number of outcomes for offences recorded in quarter. |
number_outcomes | Number of outcomes recorded in quarter. |
The police outcomes open data is already given in a tidy data format, as of
writing this documentation, this function only changes the names of columns.
It is expected that if the data format changes in future then this function
will be updated consequently. We expect this data to be cleaned by
clean_police_outcomes
.