| blockmodel | R Documentation | 
Given a set of equivalence classes (in the form of an equiv.clust object, hclust object, or membership vector) and one or more graphs, blockmodel will form a blockmodel of the input graph(s) based on the classes in question, using the specified block content type.
blockmodel(dat, ec, k=NULL, h=NULL, block.content="density", 
    plabels=NULL, glabels=NULL, rlabels=NULL, mode="digraph", 
    diag=FALSE)
| dat | one or more input graphs. | 
| ec |  equivalence classes, in the form of an object of class  | 
| k |  the number of classes to form (using  | 
| h |  the height at which to split classes (using  | 
| block.content | string indicating block content type (see below). | 
| plabels | a vector of labels to be applied to the individual nodes. | 
| glabels | a vector of labels to be applied to the graphs being modeled. | 
| rlabels | a vector of labels to be applied to the (reduced) roles. | 
| mode | a string indicating whether we are dealing with graphs or digraphs. | 
| diag | a boolean indicating whether loops are permitted. | 
Unless a vector of classes is specified, blockmodel forms its eponymous models by using cutree to cut an equivalence clustering in the fashion specified by k and h.  After forming clusters (roles), the input graphs are reordered and blockmodel reduction is applied.  Currently supported reductions are:
density: block density, computed as the mean value of the block
meanrowsum: mean row sums for the block
meancolsum: mean column sums for the block
sum: total block sum
median: median block value
min: minimum block value
max: maximum block value
types: semi-intelligent coding of blocks by “type.”  Currently recognized types are (in order of precedence) “NA” (i.e., blocks with no valid data), “null” (i.e., all values equal to zero), “complete” (i.e., all values equal to 1), “1 covered” (i.e., all rows/cols contain a 1), “1 row-covered” (i.e., all rows contain a 1), “1 col-covered” (i.e., all cols contain a 1), and “other” (i.e., none of the above). 
Density or median-based reductions are probably the most interpretable for most conventional analyses, though type-based reduction can be useful in examining certain equivalence class hypotheses (e.g., 1 covered and null blocks can be used to infer regular equivalence classes). Once a given reduction is performed, the model can be analyzed and/or expansion can be used to generate new graphs based on the inferred role structure.
An object of class blockmodel.
Carter T. Butts buttsc@uci.edu
Doreian, P.; Batagelj, V.; and Ferligoj, A. (2005). Generalized Blockmodeling. Cambridge: Cambridge University Press.
White, H.C.; Boorman, S.A.; and Breiger, R.L. (1976). “Social Structure from Multiple Networks I: Blockmodels of Roles and Positions.” American Journal of Sociology, 81, 730-779.
equiv.clust, blockmodel.expand 
#Create a random graph with _some_ edge structure
g.p<-sapply(runif(20,0,1),rep,20)  #Create a matrix of edge 
                                   #probabilities
g<-rgraph(20,tprob=g.p)            #Draw from a Bernoulli graph 
                                   #distribution
#Cluster based on structural equivalence
eq<-equiv.clust(g)
#Form a blockmodel with distance relaxation of 10
b<-blockmodel(g,eq,h=10)
plot(b)                            #Plot it
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.