force `character` variables to be factors