Factors in R

Data Science with R Programming 6 min min read Updated: Mar 07, 2026 Beginner
Factors in R
Beginner Topic 7 of 10

Factors

Factors are used to represent categorical data such as gender or country.

r factor_example <- factor(c("Male","Female","Male")) print(factor_example)

Next Tutorial: Subsetting Data

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators