Learn R Programming

signnet (version 0.8.1)

ggblock: Plot Blockmodel matrix

Description

Plot Blockmodel matrix

Usage

ggblock(
  g,
  blocks = NULL,
  cols = NULL,
  show_blocks = FALSE,
  show_labels = FALSE
)

Value

ggplot2 object

Arguments

g

igraph object. Must have a "sign" edge attribute.

blocks

vector of block membership as obtained, e.g. from signed_blockmodel

cols

colors used for negative and positive ties

show_blocks

logical. Should block borders be displayed? (Default: FALSE)

show_labels

logical. Should node labels be displayed? (Default: FALSE)

Author

David Schoch

Examples

Run this code
if (FALSE) {
library(igraph)
data("tribes")
clu <- signed_blockmodel(tribes,k = 3,alpha=0.5,annealing = TRUE)
ggblock(tribes,clu$membership,show_blocks = TRUE,show_labels = TRUE)
}

Run the code above in your browser using DataLab