Embed Graph in 2D or 3D Space
Arguments
- graph
A
dgraphobject.- edge.attribute
Explicit edge quantity, such as
"length"or"conductance";NULLuses an unweighted layout.- transform
Use selected values directly (
"identity") or their reciprocals ("reciprocal"). Selected values must be strictly positive. Fruchterman-Reingold treats larger values as stronger attraction, whereas Kamada-Kawai uses them as distances.- dim
Embedding dimension, either
2or3.- method
Layout method,
"fr"or"kk".- verbose
Logical; print timing messages.
- stage
Stored graph stage used for both topology and edge attributes.
Examples
set.seed(1)
graph <- create.graph("cycle", 6)
graph.embedding(graph, dim = 2, method = "fr")
#> [,1] [,2]
#> [1,] 3.354656 -1.982073
#> [2,] 4.709072 -2.074136
#> [3,] 5.320061 -3.289049
#> [4,] 4.583550 -4.425156
#> [5,] 3.226970 -4.332774
#> [6,] 2.610600 -3.113814