View source: R/textplot_cooccurrence.R
textplot_cooccurrence | R Documentation |
Plot term cooccurrences in a graph structure
textplot_cooccurrence(x, ...) ## Default S3 method: textplot_cooccurrence( x, terms, top_n = 50, title = "Term cooccurrences", subtitle = list(), vertex_color = "darkgreen", edge_color = "grey", base_family = "", ... )
x |
a data.frame with columns term1, term2 and cooc indicating how many times 2 terms are occurring together |
... |
other parameters passed on to |
terms |
a character vector with terms to only plot. Prevails compared to using |
top_n |
integer indicating to show only the top n occurrences as in |
title |
character string with the title to use in the plot |
subtitle |
character string with the subtitle to use in the plot |
vertex_color |
character with the color of the label of each node. Defaults to darkgreen. |
edge_color |
character with the color of the edges between the nodes. Defaults to grey. |
base_family |
character passed on to |
an object of class ggplot
library(udpipe) library(igraph) library(ggraph) library(ggplot2) data(brussels_reviews_anno, package = 'udpipe') x <- subset(brussels_reviews_anno, xpos %in% "JJ" & language %in% "fr") x <- cooccurrence(x, group = "doc_id", term = "lemma") textplot_cooccurrence(x, top_n = 25, subtitle = "showing only top 25") textplot_cooccurrence(x, top_n = 25, title = "Adjectives", vertex_color = "orange", edge_color = "black", fontface = "bold")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.