This function cleans a Utah RSA-911 dataset, based on the standard data structure.

clean_utah(
  data,
  aggregate = TRUE,
  unidentified_to_0 = TRUE,
  remove_desc = TRUE,
  remove_strictly_na = TRUE,
  clean_specials = NULL
)

Arguments

data

The Utah RSA-911 dataset.

aggregate

TRUE or FALSE. Defaults to TRUE, when TRUE, rows are aggregated to include only unique combinations of participants, year, and quarter.

unidentified_to_0

TRUE or FALSE. Defaults to TRUE, when TRUE, variables where unidentified is represented by 9, values are converted to 0.

remove_desc

TRUE or FALSE. Defaults to TRUE, when TRUE, description variables are removed to minimize redundancy.

remove_strictly_na

TRUE or FALSE. Defaults to TRUE, when TRUE, variables that contain only NA values are removed.

clean_specials

A character vector of name(s) of variables with special characters to be cleaned. New, separate variables for each value space will be appended to end of dataset with the the following naming convention: original_variable_name_Place1, original_variable_name_Place2, etc. Defaults to NULL. Note that if many are listed, cleaning process will be very slow.

Value

A cleaned data frame, with incorrect, blank, messy values replaced, additional, helpful variables created, and unnecessary variables removed.