Description Usage Arguments Value Examples
View source: R/transition_matrix.R
This method take an adjacency matrix (dense or sparse), and returns the corresponding transition matrix in the same format. If the optional argument 'directed' is specified to be FALSE, then before computing the transition matrix the adjacency matrix is forced be symmetric.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | get_transition(adj, directed = NULL, ...)
## S3 method for class 'matrix'
get_transition(adj, directed = NULL, ...)
## S3 method for class 'dgTMatrix'
get_transition(adj, directed = NULL, ...)
## S3 method for class 'dgCMatrix'
get_transition(adj, directed = NULL, ...)
## S3 method for class 'sparseMatrix'
get_transition(adj, directed = NULL, ...)
## Default S3 method:
get_transition(adj, directed = NULL, ...)
|
adj |
adjacency matrix, either dense or sparse |
directed |
boolean, optional argument specifying if the matrix refers to a directed graph. |
... |
additional parameters to and from the main method. Currently not used. |
A transition matrix in the same format of 'adj'.
1 2 3 4 5 | el <- data.frame(from= c('a','b','b','c','d','d'),
to = c('b','c','d','a','b','a'),
attr= c( 12, 6, 12 , 6 , 6 , 6 ))
adj <- el2adj(el)
t_mat <- get_transition(adj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.