BASIC COMMANDS
1- Summary (data) --> summarizes data
2- str(data) --> data structure, number variables, number data
3- RELEVEL
table <- as.data.frame(table(df$variable))
max <- which.max(table[, 2])
level.name <- as.character(table[max, 1])
df$variable <- relevel(df$variable, ref = level.name)
4 - MAPVALUES
var.levels <- levels(df$occupation) df$occupation_comb <- mapvalues(df$occupation, var.levels, c("Group12", "Group12","Group123", "Group123", "Group123", "GroupNA"))