get_block.BipartiteSBM_fit {shinySbm} | R Documentation |
get_block.BipartiteSBM_fit method
Description
A fct that return blocks attribution or probabilities for each nodes in a Sbm fit from the sbm package.
Usage
## S3 method for class 'BipartiteSBM_fit'
get_block(
x,
labels = "default",
node_names = NULL,
attribution = TRUE,
proportion = FALSE
)
Arguments
x |
Sbm model of class 'BipartiteSBM_fit'. |
labels |
labels for nodes. If it's simple sbm it should be a single character ("default" -> c("nodes")). If sbm is bipartite a named character (names are row and col) ("default" -> c(row = 'row', col = 'col')). |
node_names |
named list ("row","col"), row is a character vector containing names of nodes in rows, and respectively for columns |
attribution |
Boolean indicating whether or not the produced tables should contain a block attribution column. This column shows the block in which each nodes is the most likely to be. |
proportion |
Boolean indicating whether or not the produced tables should contain the probabilities to belong in each blocks. These columns shows for every nodes and every blocks the probabilities that the node belong to the block. |
Value
A list containing two data.frames with block attributions and/or proportions one for the row blocks and one for the column blocks
Examples
# my_sbm_bi <- sbm::estimateBipartiteSBM(sbm::fungusTreeNetwork$fungus_tree,
# model = 'bernoulli')
my_sbm_bi <- FungusTreeNetwork$sbmResults$fungus_tree
node_names_bi <- list(
row = FungusTreeNetwork$networks$fungus_names,
col = FungusTreeNetwork$networks$tree_names
)
my_blocks_bi <- get_block(my_sbm_bi,
labels = c(row = "Fungus", col = "Tree"),
node_names = node_names_bi
)
my_blocks_bi$row
my_blocks_bi$col