These operators allow for algebraic manupulation of graph adjacency matrices.
# S3 method for matrix
%c%(e1,e2)
The resulting adjacency matrix.
an (unvalued) adjacency matrix.
another (unvalued) adjacency matrix.
Carter T. Butts buttsc@uci.edu
Currently, only one operator is supported. x %c% y
returns the adjacency matrix of the composition of graphs with adjacency matrices x
and y
(respectively). (Note that this may contain loops.)
Wasserman, S. and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: University of Cambridge Press.
#Create an in-star
g<-matrix(0,6,6)
g[2:6,1]<-1
gplot(g)
#Compose g with its transpose
gcgt<-g%c%t(g)
gplot(gcgt,diag=TRUE)
gcgt
Run the code above in your browser using DataLab