Callie Silver
Callie Silver

Reputation: 25

frequency counts with categorical variables

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

Answers (1)

akrun
akrun

Reputation: 886948

We can use table from base R after subsetting the columns of interest

table(df1[c('A', 'B')])

Upvotes: 2

Related Questions