This retrieves an attribute list for all vertices of the graph.

get_vertex_attributes(g, name)

Arguments

g

A nctx graph

name

Name of the attribute

Value

The attribute values for all vertices

See also

Examples

library(RUnit) library(nctx) file <- system.file("extdata", "bcde.ctx.dir.graphml", package="nctx") g <- load_graph(file, directed = TRUE) checkEquals(get_vertex_attributes(g, "distance_to_A"), c(0.0000000,0.2938160,1.0000000,0.4637440,0.3066590,0.1263650,0.3882870,0.0927837,0.2409850,0.5995490))
#> [1] TRUE
checkEquals(get_vertex_attribute(g, "distance_to_A", 3), 1.0)
#> [1] TRUE