Add or remove columns of data as needed so that all datasets have the same columns. Also adds in an error column.

process_add_all_columns(data, vars, add_error_column = TRUE)

Arguments

data

Dataframe containing study data read in as a csv file

vars

Vector of variable columns names to be included in the final formatted tibble

add_error_column

Adds an extra column called error if TRUE

Value

Tibble with the correct selection of columns including an error column