# Most common bigrams
tail(sort(alice_bigrams), 10)
# "th" count
alice_bigrams["t", "h"]
# Visualise as a Hinton diagram
df <- matrix_to_hinton(alice_bigrams / sum(alice_bigrams))
# \donttest{
ggplot2::ggplot(df, ggplot2::aes(x = col, y = row, weight = weight)) +
geom_hinton() +
scale_fill_hinton() +
ggplot2::coord_fixed() +
theme_hinton()
# }
Run the code above in your browser using DataLab