get_net_relations_igraph: Retrieve an igraph relations network for a play

View source: R/net.R

get_net_relations_igraphR Documentation

Retrieve an igraph relations network for a play

Description

get_net_relations_igraph() a play network, given play and corpus names . The network represent kinship and other relationships data, following the encoding scheme proposed in \insertCitewiedmer_nathalie_2020_4621778rdracor.

Usage

get_net_relations_igraph(play = play, corpus = corpus, as_igraph = FALSE)

## S3 method for class 'relations_igraph'
summary(object, ...)

## S3 method for class 'relations_igraph'
plot(
  x,
  layout = igraph::layout_nicely,
  gender_colors = c(MALE = "#0073C2", FEMALE = "#EFC000", UNKNOWN = "#99979D"),
  show_others = c("vertex", "vertex_label", "none"),
  vertex_size = c(13, 4),
  vertex_label_size = c(0.8, 0.5),
  vertex_label_adjust = TRUE,
  vertex.label.color = "#03070f",
  vertex.label.family = "sans",
  vertex.label.font = 2L,
  vertex.frame.color = "white",
  edge.arrow.size = 0.25,
  edge.arrow.width = 1.5,
  edge.curved = 0.15,
  edge.label.family = "sans",
  edge.label.font = 4L,
  edge.label.cex = 0.75,
  ...
)

Arguments

play

Character, name of a play (you can find all play names in "playName" column within an object returned by get_dracor). Character vector (longer than 1) is not supported.

corpus

Character, name of the corpus (you can find all corpus names in name column within an object returned by get_dracor_meta).

as_igraph

Logical, if TRUE, returns simple igraph object instead of cooccur_igraph. FALSE by default.

object

An object of class relations_igraph.

...

Other arguments to be passed to plot.igraph

x

A relations_igraph object to plot.

layout

Function, an algorithm used for graph layout. See layout_.

gender_colors

Named vector with 3 values with colors for MALE, FEMALE and UNKNOWN respectively. Set NULL to use default igraph colors. If you set parameter vertex.color (see igraph.plotting), gender_colors will be ignored.

show_others

Character value. What to do with vertices without relations?

  • "vertex": plot only vertices without labels.

  • "vertex_label": plot both vertices and labels.

  • "none": do not plot vertices without relations.

The default is "vertex".

vertex_size

Numeric vector with two values. The first number is for nodes with relations, the second number is for all other nodes.

vertex_label_size

Numeric vector with two values. The first number defines label sizes for nodes with relations, the second number for nodes without relations.

vertex_label_adjust

Logical value. If TRUE, labels positions are moved to the top of the respective nodes. If FALSE, labels are placed in the nodes centers. TRUE by default. If you set parameter vertex.label.dist(see igraph.plotting) by yourself, vertex_label_adjust is ignored.

vertex.label.color

See igraph.plotting.

vertex.label.family

See igraph.plotting.

vertex.label.font

See igraph.plotting.

vertex.frame.color

See igraph.plotting.

edge.arrow.size

See igraph.plotting.

edge.arrow.width

See igraph.plotting.

edge.curved

See igraph.plotting.

edge.label.family

See igraph.plotting.

edge.label.font

See igraph.plotting.

edge.label.cex

See igraph.plotting.

Value

relations_igraph — an object that inherits igraph and can be treated as such.

Functions

  • summary(relations_igraph): Meaningful summary for "relations_igraph" object: relationships and their type.

  • plot(relations_igraph): Plot relations_igraph using plot.igraph with slightly modified defaults.

References

\insertAllCited

See Also

get_net_cooccur_igraph

Examples


galotti_relations <- get_net_relations_igraph(
  play = "lessing-emilia-galotti",
  corpus = "ger"
)
plot(galotti_relations)
summary(galotti_relations)


Pozdniakov/rdracor documentation built on April 9, 2024, 1:20 a.m.