This function cleans a TRT scores dataset, based on the standard data structure.

clean_scores(
  data,
  state_filter = NULL,
  clean_id = TRUE,
  aggregate = TRUE,
  id_col = NULL
)

Arguments

data

The TRT scores dataset.

state_filter

A character vector identifying the state(s) of interest. Defaults to NULL.

clean_id

TRUE or FALSE. Defaults to TRUE, when TRUE, rows where participant ID is missing are removed.

aggregate

TRUE or FALSE. Defaults to TRUE, when TRUE, rows are aggregated to include only unique participants are kept.

id_col

Differing variable naming structure for participant ID. (Eg. "X", or another name not similar to "participant" or "ID".) Defaults to NULL.

Value

A cleaned data frame, restructured to a wide format, to help with merging process.