Skip to contents

produce a flextable describing a pam object. The function is only using package 'broom' that provides the data presented in the resulting flextable.

Usage

# S3 method for class 'pam'
as_flextable(x, digits = 4, ...)

Arguments

x

a cluster::pam() object

digits

number of digits for the numeric columns

...

unused argument

Examples

if (require("cluster")) {
  dat <- as.data.frame(scale(mtcars[1:7]))
  cl <- pam(dat, 3)
  ft <- as_flextable(cl)
  ft
}
#> Loading required package: cluster

variable

1

2

3

size

6

11

15

max.diss

2.2

2.8

3.2

avg.diss

1.1

1.4

1.6

diameter

2.8

4.0

5.1

separation

1.0

1.5

1.0

avg.width

0.4

0.2

0.3

mpg*

0.1509

1.1962

-0.6124

cyl*

-0.1050

-1.2249

1.0149

disp*

-0.5706

-1.2242

0.3637

hp*

-0.5351

-1.1768

0.4859

drat*

0.5675

0.9042

-0.9848

wt*

-0.3498

-1.3105

0.8715

qsec*

-0.4638

0.5883

-0.2511

(*) Centers

The average silhouette width is 0.2959