Nothing
#' Mean Eigenvalue Centrality
#'
#' @description Calculate the mean eigenvalue centrality of a graph.
#' @param g The input network.
#' @details \code{metric.eigen.mean} calculates the mean eigenvalue centrality score of graph \emph{g}.
#' @return A real constant.
#' @author Xu Dong, Nazrul Shaikh.
#' @references Bonacich, Phillip, and Paulette Lloyd. "Eigenvector-like measures of centrality for asymmetric relations." Social networks 23, no. 3 (2001): 191-201.
#' @references Borgatti, Stephen P. "Centrality and network flow." Social networks 27, no. 1 (2005): 55-71.
#' @examples \dontrun{
#' x <- net.erdos.renyi.gnp(1000, 0.01)
#' metric.eigen.mean(x)}
#' @export
#' @import igraph
#'
metric.eigen.mean <- function (g) {
if (!is.list(g)) stop("Parameter 'g' must be a list",call. = FALSE)
ig <- simplify(as.undirected(graph_from_adj_list(g)))
EC <- eigen_centrality(ig, directed = FALSE, scale = TRUE) ## same as unscaled spectrum(g)
ecmean <- mean(EC$vector)
ecmean
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.