File: vertex_attr-set.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (59 lines) | stat: -rw-r--r-- 1,532 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attributes.R
\name{vertex_attr<-}
\alias{vertex_attr<-}
\alias{vertex.attributes<-}
\title{Set one or more vertex attributes}
\usage{
vertex_attr(graph, name, index = V(graph)) <- value
}
\arguments{
\item{graph}{The graph.}

\item{name}{The name of the vertex attribute to set. If missing,
then \code{value} must be a named list, and its entries are
set as vertex attributes.}

\item{index}{An optional vertex sequence to set the attributes
of a subset of vertices.}

\item{value}{The new value of the attribute(s) for all
(or \code{index}) vertices.}
}
\value{
The graph, with the vertex attribute(s) added or set.
}
\description{
Set one or more vertex attributes
}
\examples{
g <- make_ring(10)
vertex_attr(g) <- list(
  name = LETTERS[1:10],
  color = rep("yellow", gorder(g))
)
vertex_attr(g, "label") <- V(g)$name
g
plot(g)
}
\seealso{
Vertex, edge and graph attributes
\code{\link{delete_edge_attr}()},
\code{\link{delete_graph_attr}()},
\code{\link{delete_vertex_attr}()},
\code{\link{edge_attr}()},
\code{\link{edge_attr<-}()},
\code{\link{edge_attr_names}()},
\code{\link{graph_attr}()},
\code{\link{graph_attr<-}()},
\code{\link{graph_attr_names}()},
\code{\link{igraph-attribute-combination}},
\code{\link{igraph-dollar}},
\code{\link{igraph-vs-attributes}},
\code{\link{set_edge_attr}()},
\code{\link{set_graph_attr}()},
\code{\link{set_vertex_attr}()},
\code{\link{vertex_attr}()},
\code{\link{vertex_attr_names}()}
}
\concept{attributes}