graphcent
takes one or more graphs (dat
) and returns the Harary graph centralities of positions (selected by nodes
) within the graphs indicated by g
. Depending on the specified mode, graph centrality on directed or undirected geodesics will be returned; this function is compatible with centralization
, and will return the theoretical maximum absolute deviation (from maximum) conditional on size (which is used by centralization
to normalize the observed centralization score).
graphcent(dat, g=1, nodes=NULL, gmode="digraph", diag=FALSE, tmaxdev=FALSE, cmode="directed", geodist.precomp=NULL, rescale=FALSE, ignore.eval)
g==1
. gmode
is set to "digraph" by default. diag
is FALSE
by default. tmaxdev==FALSE
. geodist
object precomputed for the graph to be analyzed (optional) closeness
, which is based on the reciprocal of the sum of distances to all other vertices (rather than simply the maximum).
centralization
g<-rgraph(10) #Draw a random graph with 10 members
graphcent(g) #Compute centrality scores
Run the code above in your browser using DataLab