Skip to contents

From a dataframe of graph frequence, plot a graph plot a graph of co-occurrence of terms, as returned by get_cooc_entities, extract_graph. It displays a simple graph to check the cooccurences. To display the weights of edges and different node values, see plot_graph2.

Usage

plot_graph(
  DF,
  head_n = 30,
  edge_color = "lightblue",
  edge_alpha = 0.5,
  edge_width = 1,
  edge_type = "arc",
  edge_bend = 0.5,
  edge_cut = 0,
  node_alpha = 0.5,
  text_color = "black",
  text_size = 3,
  text_contour_color = NA,
  layout = "kk"
)

Arguments

head_n

number of nodes to show - the more frequent

edge_color

color of the edges

edge_alpha

transparency of the edges. Values between 0 and 1.

edge_width

edge of the edges

edge_type

the type of link between nodes, if straight line or banded arcs. Values: "arc" (or "curved") and "line". Default = "arc"

edge_bend

the degree of arc bending when edge_type = "arc". The values oscillates between -1 and 1, where 0 is a straight line, and negative numbers invert the arc.

edge_cut

in mm, how much you want that the edge stop before reach the node. Can improve readability.

node_alpha

transparency of the nodes

text_color

color of the text in nodes

text_size

font size of the nodes

layout

the layout of the plot. Options are bipartite, star, circle, nicely, dh, gem, graphopt, grid, mds, sphere, randomly, fr, kk, drl, lgl. More info at ?displays or at ggraph documentation.

text

an input text

df

a dataframe of co-occurrence, extracted with `extract_graph()` and `count(n1, n2)`

Examples

# plot_graph(df = graph_count, head_n = 50, scale_graph = "log2")