## 8.8 Group factor levels together - fct_collapse()

Our question relates to the association between tumour ulceration and death from melanoma. The outcome measure has three levels as can be seen. For our purposes here, we will generate a disease-specific mortality variable (status_dss), by combining “Died - other causes” and “Alive”.

meldata <- meldata %>%
mutate(
status_dss = fct_collapse(
status.factor,
"Alive" = c("Alive", "Died - other causes"))
)