I would like to use a 'THEN DO' structure in R, but unfortunately, I haven't been able to find an equivalent option. Is there any way to achieve this? Specifically, I want to derive both ASEX and ASEXN in the same step not with multiple ifelse.
dm_plus <- left_join(dm, suppdm, by = "USUBJID") %>%
mutate(ASEX = ifelse(SEX == "M", "Male",
ifelse(SEX == "F", "Female", NA))),