Degree
takes a graph stack (dat
) and returns the degree centralities of positions within one graph (indicated by nodes
and g
, respectively). Depending on the specified mode, indegree, outdegree, or total (Freeman) degree 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).degree(dat, g=1, nodes=c(1:dim(dat)[2]), gmode="digraph", diag=FALSE,
tmaxdev=FALSE, cmode="freeman", rescale=FALSE)
FUN
is well-behaved, this can be an n x n matrix if only one graph is involved.g==1
.gmode
is set to "digraph" by default.diag
is FALSE
by default.tmaxdev==FALSE
.cmode
is "freeman".centralization
#Create a random directed graph
dat<-rgraph(10)
#Find the indegrees, outdegrees, and total degrees
degree(dat,cmode="indegree")
degree(dat,cmode="outdegree")
degree(dat)
Run the code above in your browser using DataLab