Skip to contents

A fct that build a flextable from an sbm object

Usage

get_flextable(
  sbm,
  labels = "default",
  type = c("blockProp", "connectParam", "storedModels"),
  settings = list()
)

Arguments

sbm

an sbm model product of sbm estimation (simple or bipartite)

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')).

type

the type of table wanted.

settings

a list of settings

Value

Return the selected flextable

Details

Values of type

  • 'blockProp': gives the block proportions.

  • 'connectParam': gives the block connectivity.

  • 'storedModels': gives the stored modems summary.

The list of parameters settings for the flextable

  • "caption": Caption is the flextable title (character)

  • "digits": nb of digits wanted to be shown in the table

  • "selected_col": Color highlighting the selected model

  • "best_col": Color of text for the best model

Examples


# my_sbm <- sbm::estimateBipartiteSBM(sbm::fungusTreeNetwork$fungus_tree,
#                                     model = 'bernoulli')
my_sbm <- FungusTreeNetwork$sbmResults$fungus_tree

get_flextable(my_sbm,
  labels = c(row = "Fungus", col = "Trees"),
  type = "blockProp"
)
Table 1: Block proportions

Blocks

Fungus

Trees

1

0.03

0.11

2

0.06

0.20

3

0.32

0.25

4

0.59

0.44

get_flextable(my_sbm, labels = c(row = "Fungus", col = "Trees"), type = "connectParam", settings = list(digits = 5) )
Table 2: Connectivity betweens blocks

Trees

1

2

3

4

Fungus

1

0.96813

0.07754

0.84037

0.06756

2

0.52056

0.58440

0.23089

0.10793

3

0.32450

0.00362

0.09853

0.00578

4

0.01835

0.15433

0.00133

0.01922

get_flextable(my_sbm, labels = "default", type = "storedModels", settings = list(caption = "New Title") )
New Title

Nb of row blocks

Nb of col blocks

Total nb of blocks

ICL

log-Likelihood

Nb of parameters

1

1

2

-1,978.98

-1,974.50

1

2

1

3

-1,839.18

-1,827.69

3

2

2

4

-1,721.53

-1,699.11

6

2

3

5

-1,705.15

-1,671.80

9

3

3

6

-1,670.17

-1,620.84

13

4

3

7

-1,652.33

-1,587.03

17

4

4

8

-1,641.48

-1,556.28

22

5

4

9

-1,651.74

-1,546.08

27

5

5

10

-1,662.93

-1,532.88

33

6

5

11

-1,680.76

-1,525.77

39

7

5

12

-1,703.21

-1,523.28

45

8

5

13

-1,724.53

-1,519.66

51

9

5

14

-1,751.54

-1,521.73

57