~/ learn/ afm-112/ cards/ Levels, and why their order matters
1 of 8

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.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/1930d7d3-8b75-4921-859f-dce1450069d5/flashcard utf-8 LF