I'm basically trying to do what is described in this question R Loop for Variable Names to run linear regression model (i.e. swapping out one independent variable while all others stay constant)

except that I'd like to run a classification model as opposed to a linear regression. Any classification model will do, the simpler the better. Can anyone provide a basic guideline of what this kind of code would look like?