Replicate a case study of marketing analytics: https://www.linkedin.com/learning/the-data-science-of-marketing/cluster-analysis-with-r?u=2232593
myClusterData <- read.csv("cluster-r.csv")
head(myClusterData)
## Email Behavior.3 Brand.Preference CTA
## 1 nisl@adipiscingelit.org 16 12 9
## 2 dui.Fusce.diam@non.edu 25 8 6
## 3 nisl.Maecenas@vitaeorciPhasellus.org 23 11 4
## 4 justo.nec@Aenean.edu 4 12 11
## 5 neque.Morbi.quis@AeneanmassaInteger.ca 29 10 2
## 6 elit@erat.org 16 6 13
## Demo.Age
## 1 48
## 2 41
## 3 50
## 4 34
## 5 59
## 6 57
myClusterDataStandardized <- scale(myClusterData[-1])
Standardization is to get more in depth with the data then the regular data.
ourGroups <- kmeans(myClusterDataStandardized, 3)
library(cluster)
ourGroups$size
## [1] 93 95 112
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.