Extract an edge attribute.

edge_get_attr(.net, .edge_attr, .edge_index = edge_seq(.net))

# S3 method for igraph
edge_get_attr(.net, .edge_attr,
  .edge_index = edge_seq(.net))

# S3 method for network
edge_get_attr(.net, .edge_attr,
  .edge_index = edge_seq(.net))

Arguments

.net

network of class igraph or network.

.edge_attr

character scalar corresponding to the name of a edge attribute in .net.

.edge_index

numeric or logical vector indicating which edges to target.

Value

vector (typically)

Examples

edge_get_attr(.net = florence_business_ig, .edge_attr = "edge_type")
#> [1] "business" "business" "business" "business" "business" "business" #> [7] "business" "business" "business" "business" "business" "business" #> [13] "business" "business" "business" "business" "business" "business" #> [19] "business" "business" "business" "business" "business" "business" #> [25] "business" "business" "business" "business" "business" "business"
florence_marriage_nw %>% edge_get_attr(.edge_attr = "edge_type")
#> [1] "marital" "marital" "marital" "marital" "marital" "marital" "marital" #> [8] "marital" "marital" "marital" "marital" "marital" "marital" "marital" #> [15] "marital" "marital" "marital" "marital" "marital" "marital" "marital" #> [22] "marital" "marital" "marital" "marital" "marital" "marital" "marital" #> [29] "marital" "marital" "marital" "marital" "marital" "marital" "marital" #> [36] "marital" "marital" "marital" "marital" "marital"
florence_marriage_nw %>% edge_get_attr(.edge_attr = "edge_type", .edge_index = 1:5)
#> [1] "marital" "marital" "marital" "marital" "marital"