Group Factor Levels in R (Example) | Combine into Same Category | Regroup, Modify, Change & Merge

Опубликовано: 24 Июль 2026
на канале: Statistics Globe
6,105
48

How to regroup factor levels of a factor vector or column in the R programming language. More details: https://statisticsglobe.com/group-fac...
R code of this video:

x <- factor(c("a", "b", "a", "c", "c")) # Create example factor
x # Print example factor

x_new <- x # Duplicate example factor
levels(x_new) <- c("a", "b", "b") # Regroup factor levels
x_new # Print updated factor

Follow me on Social Media:
Facebook – Statistics Globe Page:   / statisticsglobecom  
Facebook – Group for Discussions & Questions:   / statisticsglobe  
LinkedIn – Statistics Globe Page:   / statisticsglobe  
LinkedIn – Group for Discussions & Questions:   / 12555223  
Twitter:   / joachimschork  

Music by bensound.com