powered by
Center the adjacency matrix by re-weighting edges according to a specified scheme
center_graph(A, scheme = c(-1, 1), use_splr = TRUE)
centered adjacency matrix as a splrMatrix if useSplr = TRUE, otherwise as a Matrix object.
A matrix, an igraph object. Adjacency matrix.
A character vector, number or pair of numbers. Default c(-1, 1). See Details.
c(-1, 1)
A boolean indicating whether to use the splrMatrix object when storing the centered graph. Defaults to TRUE.
The options for scheme are
"naive" Returns original A
Integer: Returns \(A - A_{scheme}\) where \(A_{scheme}\) is the best rank-scheme approximation of A.
A pair of scalars: Returns s * A + a such that the minimum of the returned matrix is min(scheme) and the maximum is max(scheme).
"center": Same as scheme=c(-1,1)
scheme=c(-1,1)
A <- sample_correlated_gnp_pair(n = 10, corr = .5, p = .5)$graph1 center_graph(A, scheme = "naive") center_graph(A, scheme = "center") center_graph(A, scheme = 2) center_graph(A, scheme = c(-4, 2))
Run the code above in your browser using DataLab