Reputation: 25
I have two categorical variables.
Variable A has about 15 levels and Variable B is dummy coded (0,1)
I am looking to get a table with the frequency counts of 1's in Variable B for each of the 15 levels of Variable A.
Upvotes: 2
Views: 201
Reputation: 886948
We can use table
from base R
after subsetting the columns of interest
table(df1[c('A', 'B')])
Upvotes: 2