I have the following 2 lines of code that I would like to make into a one-liner (would like to do it with base R). Any help would be appreciated.
#recode the sex variable
ibr.sub$SEX[ibr.sub$SEX == "1" | ibr.sub$SEX == "3"] <- "-1"
ibr.sub$SEX[ibr.sub$SEX == "2" | ibr.sub$SEX == "4"] <- "1"