I have loaded a dataset, D, into R and I would like to perform a frequency of all the variables in D versus D$binary_outcome. How do I do that?
I would like to know if there is some code that is fairly generic and D may have any number of variables and the code should be able to handle a dataset with any number of variables.
In effect I want to be able to do something like
d = read.csv("c:/d.csv")
d.freq.varA = table(d$varA,d$binary_outcome)
d.freq.varB = table(d$varB,d$binary_outcome)
...
d.freq.varZZZ = table(d$varZZZ,d$binary_outcome)
for all variables A to ZZZ in d.