library(ggplot2)
g <- ggplot(data = bigram_tf_idf2, aes(x = tf_idf, y = bigram)) +
geom_bar(stat = 'identity') +
coord_flip()
g + facet_wrap(~ book, ncol = 2)
bigram_tf_idf2 <- data.frame(book = c('Persuasion','Mansfield Park','Mansfield Park','Persuasion','Persuasion','Emma','Northanger Abbey','Sense & Sensibility','Emma','Pride & Prejudice'),
bigram = c('captain wentworth','sir thomas','miss crawford','lady russell','sir walter', 'miss woodhouse', 'miss tilney', 'colonel brandon', 'frank churchill', 'lady catherine'),
tf_idf = c(0.0535, 0.0515, 0.0386, 0.0371, 0.0356, 0.0305, 0.0286, 0.0269, 0.0248, 0.0247))