Factors in R Programming

In R programming, factors are variables that take on a limited number of different values. Factors are used to represent categorical data.

Some examples of factors:

  • A common example of a factor is gender, which can have category values as Male and Female.
  • A data field such as marital status may contain only values from single, married, separated, divorced, or widowed.
  • For stocks, we can have them categorized as Large-cap, Mid-cap, and Small-cap
Continue Reading
Free Content, Requires Login

This content is free but requires you to be logged in to access.

Create a free account to access this tutorial and all other free tutorials, courses, and resources.