I have a dataframe in R with three variables named for example df$V1, df$V2, df$V3. df$V1 and df$V2 are both
df$V1
df$V2
df$V3
This is an alternative to table:
table
xtabs(V3 ~ V1 + V2, df)