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

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

Arguments

x

a 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
#> a flextable object.
#> col_keys: `variable`, `dummy1`, `1@zz`, `dummy2`, `2@zz`, `dummy3`, `3@zz` 
#> header has 1 row(s) 
#> body has 13 row(s) 
#> original dataset sample: 
#>     variable   value@1   value@2    value@3 zz@1 zz@2 zz@3 dummy1 1@zz dummy2
#> 1       size 6.0000000 11.000000 15.0000000                                  
#> 2   max.diss 2.2218113  2.761741  3.1598912                                  
#> 3   avg.diss 1.0581584  1.424855  1.5906900                                  
#> 4   diameter 2.8103301  3.993352  5.0598115                                  
#> 5 separation 0.9936969  1.476439  0.9936969                                  
#>   2@zz dummy3 3@zz
#> 1                 
#> 2                 
#> 3                 
#> 4                 
#> 5