powered by
Convert labelled factors to regular factors
convert_factor(data)
A data frame with labelled factors converted to regular factors.
A data frame, tibble, or tsg object containing labelled factors.
tsg
df <- data.frame( category = haven::labelled( c(1, 2, 3), c("One" = 1, "Two" = 2, "Three" = 3) ) ) df_converted <- convert_factor(df)
Run the code above in your browser using DataLab