R uses factors to handle categorical variables, variables that have a fixed and known set of possible values.