In R, with prov4 <- c("ON", "QC", "ON", "BC"), type the assignment that converts it to a factor named prov_f.
In R, with prov4 <- c("ON", "QC", "ON", "BC"), type the assignment that converts it to a factor named prov_f.
Answer
prov_f <- factor(prov4)
Printing prov_f gives [1] ON QC ON BC and a second line, Levels: BC ON QC — the distinct categories, alphabetical by default.