spt | R Documentation |
spt method
spt(x, from, to, weights = NULL, ...)
x |
a igraph object |
from |
a specific node of network. |
to |
other nodes of the network, length of it must be larger than 2. |
weights |
a numeric vector giving edge weights or a character.
If this is |
... |
additional parameters |
phylo object
library(igraph)
set.seed(123)
g <- igraph::sample_gnp(100, .1) %>%
set_edge_attr(name='weight', value=abs(rnorm(E(.),3)))
tr1 <- spt(g, from = 6, to=V(g), weights = 'weight')
tr1
tr2 <- spt(g, from = 6, to = V(g), weights = NA)
tr2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.