Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_vertex_attr

Set vertex attributes


Description

Set vertex attributes

Usage

set_vertex_attr(graph, name, index = V(graph), value)

Arguments

graph

The graph.

name

The name of the attribute to set.

index

An optional vertex sequence to set the attributes of a subset of vertices.

value

The new value of the attribute for all (or index) vertices.

Value

The graph, with the vertex attribute added or set.

See Also

Examples

g <- make_ring(10) %>%
  set_vertex_attr("label", value = LETTERS[1:10])
g
plot(g)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.