Logistic Regression in R | Logistic Regression code example Example: how to code binary response in r data$response <- ifelse(response == "yes", 1, 0)