You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chap7.R
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,18 @@ library(ggplot2)
22
22
#' ruspini_scaled data is in package cluster. It is a very simple data set with well separated clusters.
23
23
data(ruspini, package="cluster")
24
24
25
-
#' Shuffle rows
25
+
#' Shuffle rows (using `sample_frac` which samples by default 100%).
26
26
ruspini<- as_tibble(ruspini) %>% sample_frac()
27
27
ruspini
28
28
29
29
ggplot(ruspini, aes(x=x, y=y)) + geom_point()
30
30
31
31
#' Scale each column in the data to zero mean and unit standard deviation (z-scores). This prevents one attribute with a large range to dominate the others for the distance calculation.
0 commit comments