W tym celu została zastosowana funkcja scale() w języku R.

# Load the data animals <- cluster::animals colnames(animals) <- c("warm-blooded", "can fly", "vertebrate", "endangered", "live in groups", "have hair") Poniżej przedstawiono fragment zestawu danych. > head(animals) warm-blooded can fly vertebrate endangered live in groups have hair ant 1 1 1 1 2 1 bee 1 2 1 1 2 2 cat 2 1 2 1 1 2 cpl 1 1 1 1 1 2 chi 2 1 2 2 2 2 cow 2 1 2 1 2 2

# Standardize the data df<-scale(animals) head(df, nrow = 6)

Po ustandaryzowaniu danych, prezentują się one następująco:

> head(df, nrow = 6) warm-blooded can fly vertebrate endangered live in groups have hair ant -0.9746794 -0.4873397 -1.4888474 -0.6871843 0.7164977 -0.8816307 bee -0.9746794 1.9493589 -1.4888474 -0.6871843 0.7164977 1.0775487 cat 0.9746794 -0.4873397 0.6380775 -0.6871843 -1.3135792 1.0775487 cpl -0.9746794 -0.4873397 -1.4888474 -0.6871843 -1.3135792 1.0775487 chi 0.9746794 -0.4873397 0.6380775 1.3743685 0.7164977 1.0775487 cow 0.9746794 -0.4873397 0.6380775 -0.6871843 0.7164977 1.0775487