| degree {sna} | R Documentation |
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)
dat |
Data array to be analyzed. By assumption, the first dimension of the array indexes the graph, with the next two indexing the actors. Provided that FUN is well-behaved, this can be an n x n matrix if only one graph is involved. |
g |
Integer indicating the index of the graph for which centralities are to be calculated. By default, g==1. |
nodes |
List indicating which nodes are to be included in the calculation. By default, all nodes are included. |
gmode |
String indicating the type of graph being evaluated. "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected. gmode is set to "digraph" by default. |
diag |
Boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. diag is FALSE by default. |
tmaxdev |
Boolean indicating whether or not the theoretical maximum absolute deviation from the maximum nodal centrality should be returned. By default, tmaxdev==FALSE. |
cmode |
String indicating the type of degree centrality being computed. "indegree", "outdegree", and "freeman" refer to the indegree, outdegree, and total (Freeman) degree measures, respectively. The default for cmode is "freeman". |
rescale |
If true, centrality scores are rescaled such that they sum to 1. |
Degree centrality is the social networker's term for various permutations of the graph theoretic notion of vertex degree: indegree of a vertex, v, corresponds to the cardinality of the vertex set N^+(v) = {i in V(G) : (i,v) in E(G)}; outdegree corresponds to the cardinality of the vertex set N^-(v) = {i in V(G) : (v,i) in E(G)}; and total (or "Freeman") degree corresponds to |N^+(v)|+|N^-(v)|. (Note that, for simple graphs, indegree=outdegree=total degree/2.) Obviously, degree centrality can be interpreted in terms of the sizes of actors' neighborhoods within the larger structure. See the references below for more details.
A vector containing the degree centrality scores
Carter T. Butts ctb@andrew.cmu.edu
Freeman, L.C. (1979). ``Centrality in Social Networks I: Conceptual Clarification.'' Social Networks, 1, 215-239.
#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)