get_net_cooccur_igraph {rdracor} | R Documentation |
Retrieve an igraph co-occurrence network for a play
Description
get_net_cooccur_igraph()
returns a play network, given play and corpus
names. Play network is constructed based on characters' co-occurrence matrix.
Each node (vertex) is a character (circle) or a group of characters (square),
edges width is proportional to the number of common play segments where two
characters occur together.
Usage
get_net_cooccur_igraph(play = NULL, corpus = NULL, as_igraph = FALSE)
## S3 method for class 'cooccur_igraph'
plot(
x,
layout = igraph::layout_with_kk,
vertex.label = label_cooccur_igraph(x),
gender_colors = c(MALE = "#0073C2", FEMALE = "#EFC000", UNKNOWN = "#99979D"),
vertex_size_metric = c("numOfWords", "numOfScenes", "numOfSpeechActs", "degree",
"weightedDegree", "closeness", "betweenness", "eigenvector"),
vertex_size_scale = c(5, 20),
edge_size_scale = c(0.5, 4),
vertex_label_adjust = TRUE,
vertex.label.color = "#03070f",
vertex.label.family = "sans",
vertex.label.font = 2L,
vertex.frame.color = "white",
...
)
## S3 method for class 'cooccur_igraph'
summary(object, ...)
Arguments
play |
Character, name of a play (you can find all play names in
|
corpus |
Character, name of the corpus (you can find all corpus names in
|
as_igraph |
Logical, if |
x |
A |
layout |
Function, an algorithm used for the graph layout. See igraph.plotting. |
vertex.label |
Character vector of character names. By default,
function |
gender_colors |
Named vector with 3 values with colors for
MALE, FEMALE and UNKNOWN respectively. Set |
vertex_size_metric |
Character value, one of |
vertex_size_scale |
Numeric vector with two values. The first number is
for mean size of node(vertex), the second one is for node size variance. If
you specify vertex size by yourself using parameter
|
edge_size_scale |
Numeric vector with two values. The first number
defines average size of edges, the second number defines edges size variance.
If you specify edges size by yourself using parameter
|
vertex_label_adjust |
Logical. If |
vertex.label.color |
See igraph.plotting. |
vertex.label.family |
See igraph.plotting. |
vertex.label.font |
See igraph.plotting. |
vertex.frame.color |
See igraph.plotting. |
... |
Other arguments to be passed to plot.igraph |
object |
An object of class |
Value
cooccur_igraph
— an object that inherits igraph
and can be
treated as such.
Functions
-
plot(cooccur_igraph)
: Plotcooccur_igraph
usingplot.igraph
with slightly modified defaults. -
summary(cooccur_igraph)
: Meaningful summary for"cooccur_igraph"
object: network properties, gender distribution
See Also
get_net_relations_igraph
label_cooccur_igraph
Examples
emilia_igraph <- get_net_cooccur_igraph(
play = "lessing-emilia-galotti",
corpus = "ger"
)
igraph::diameter(emilia_igraph)
plot(emilia_igraph)
summary(emilia_igraph)