Factors
module 5
week 9
collapse
factors
labels
levels
recode
Work with categorical variables (factors)
We often work with categorical variables, and R coerces them into a special data type called a factor. Factors are augmented integers with levels and labels.
Learning objectives
- Check levels of factors
- Reorder factor levels
- Recode factor labels
Pre-meeting
To prepare for this class meeting, please do the following:
- Read R4DS2 17
Class meeting
Homework after the class meeting
Wrap up this lesson
- Complete the exercises
For next class meeting
- Read R4DS2 18