bl62 %>%
select(-aa) %>%
kmeans(centers = 6, iter.max = 1000, nstart = 10) %>%
augment(bl62_pca_aug) %>%
head
## # A tibble: 6 x 44
## .rownames aa A R N D C Q E G H
## <fct> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 1 A 4 -1 -2 -2 0 -1 -1 0 -2
## 2 2 R -1 5 0 -2 -3 1 0 -2 0
## 3 3 N -2 0 6 1 -3 0 0 0 1
## 4 4 D -2 -2 1 6 -3 0 2 -1 -1
## 5 5 C 0 -3 -3 -3 9 -3 -4 -3 -3
## 6 6 Q -1 1 0 0 -3 5 2 -2 0
## # … with 33 more variables: I <dbl>, L <dbl>, K <dbl>, M <dbl>, F <dbl>,
## # P <dbl>, S <dbl>, T <dbl>, W <dbl>, Y <dbl>, V <dbl>,
## # .fittedPC1 <dbl>, .fittedPC2 <dbl>, .fittedPC3 <dbl>,
## # .fittedPC4 <dbl>, .fittedPC5 <dbl>, .fittedPC6 <dbl>,
## # .fittedPC7 <dbl>, .fittedPC8 <dbl>, .fittedPC9 <dbl>,
## # .fittedPC10 <dbl>, .fittedPC11 <dbl>, .fittedPC12 <dbl>,
## # .fittedPC13 <dbl>, .fittedPC14 <dbl>, .fittedPC15 <dbl>,
## # .fittedPC16 <dbl>, .fittedPC17 <dbl>, .fittedPC18 <dbl>,
## # .fittedPC19 <dbl>, .fittedPC20 <dbl>, chem_class <fct>, .cluster <fct>