R Data StructuresLesson 23Free preview
R Factors
This lesson is part of R · All levels
Summary
This lesson discusses Factors in R that are specifically designed to handle categorical data. The categorical variables have a finite set of values called 'levels'. Factors are very crucial in statistical modeling such as linear regression and ANOVA to differentiate group treatment.
Key points
- Factors are used to manage categorical data either sequentially (ordinal) or non-sequential (nominal)
- It is done by calling the function 'factor(vektor)'
- The 'levels()' function displays a list of unique categories recognized by factors
- The parameter 'ordered = TRUE' is used to create a tiered category (e.g.: Low < While < High)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.