label_cooccur_igraph {rdracor} | R Documentation |
Extract labels for plotting 'cooccur_igraph' object
Description
label_cooccur_igraph()
returns labels for plotting cooccur_igraph
object. label_cooccur_igraph
gives control of overplotting for labels (i.e. character names) by deleting
extra labels if there are too many of them. Thus, it highlights the most
significant characters of the selected play. This function can be used to set
vertex.label
parameter for plot.cooccur_igraph
.
Usage
label_cooccur_igraph(
graph,
max_graph_size = 30L,
top_nodes = 3L,
label_size_metric = c("betweenness", "numOfWords", "numOfScenes", "numOfSpeechActs",
"degree", "weightedDegree", "closeness", "eigenvector")
)
Arguments
graph |
|
max_graph_size |
Integer, maximum network size for plotting all labels.
If you don't want to delete any labels, set |
top_nodes |
Integer, number of labels to be plotted. Characters with the highest number of words will be selected. |
label_size_metric |
Character, a metric that is used to rank characters in a play. |
Details
label_cooccur_igraph
takes labels from a vertices data frame column
"name"
, checks that network size is more than max_graph_size
,
if it is true, returns names for top top_nodes
and NA for the rest.
Value
Character vector of character names.
See Also
Examples
emilia_igraph <- get_net_cooccur_igraph(
play = "lessing-emilia-galotti",
corpus = "ger"
)
label_cooccur_igraph(emilia_igraph, max_graph_size = 10, top_nodes = 4)