View source: R/later_embedding_gePHATE.R
Graph Embedding with PHATE
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## load the karate club data
data(karate, package="T4network")
## extract the label
karate.lab = karate$label
## gePHATE with different metrizations
karate.eff = gePHATE(karate$A, metrize="effective")
## prepare for igraph plotting tools
obj.igraph = igraph::graph_from_adjacency_matrix(karate$A, mode="undirected")
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2))
plot(obj.igraph, vertex.color=karate.lab, vertex.label=NA,
main="igraph visualization")
plot(obj.igraph, vertex.color=karate.lab, vertex.label=NA,
layout=karate.eff$embed, main="gePHATE-effective")
par(opar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.