suppressMessages(library("frab"))
I <- matrix(sample(letters[1:4],15,replace=T),ncol=3)
colnames(I) <- state.abb[1:3]
I
#> AL AK AZ
#> [1,] "b" "b" "c"
#> [2,] "d" "a" "b"
#> [3,] "c" "b" "a"
#> [4,] "c" "a" "d"
#> [5,] "b" "a" "b"
sparsetable(I)
#> val
#> b a b = 1
#> b b c = 1
#> c a d = 1
#> c b a = 1
#> d a b = 1
Created on 2023-08-11 with reprex v2.0.2