Validates apportionment data input into the API functions.

validate_apportion_data(apportion_data)

Details

Validates by the following criteria:

  • Columns include index_offence_group, year_ending, and number_reoffences.

  • Warns if there are more than one year_ending values as only the closest will be selected.

  • Ensures there isn't a reoffence_group column.

  • Warns if there are more than one numeric column as summaries might be odd.

  • Warns if reoffence groups outside those accepted are input, as these will not be counted.

  • Ensures number_reoffences is numeric.

  • Ensures the user_data is within the scope of the latest data in the package.