A factor is a vector object used to specify a discrete classification of the components of other vectors of the same length. . provides both ordered and unordered factors.