Data
I have created this fake dataset for my example:
#### Library ####
library(tidyverse)
#### Create Five Random Binomial Distributions ####
x1 <- round(rbinom(n=1000,
size=1,
prob=.5))
x2 <- round(rbinom(n=1000,
size=1,
prob=.5))
x3 <- round(rbinom(n=1000,
size=1,
prob=.5))
x4 <- round(rbinom(n=1000,
size=1,
prob=.5))
x5 <- round(rbinom(n=1000,
size=1,
prob=.5))
#### Merge Into Tibble ####
df <- data.frame(x1,x2,x3,x4,x5)
tib <- as_tibble(df)
tib
Problem
Gathering the data and tabulating them after is fairly straightforward and easy for getting counts of all the variables:
tib %>%
gather() %>%
table()
However, in a case where there are 100 variables in a dataset, this can be difficult to read. Additionally, I'm looking to see if there are exact matches in tabulations. For example, if X1 and X2 both have counts of n=0 and n=1 being the exact same:
0 1
x1 40 1000
x2 40 1000
...I would like a way to flag these exact matches of counts without scrolling through miles of tabulations. Is there a way of achieving this?