levels(gender)[1] levels(gender)[2] gender levels(gender)<- c("male", "female") gender