Chapter 21 Data Cleaning/Wrangling

Importantly, k-means requires full observations to work. In other words, if you have any values that are NA, then kmeans() will not work. We can remove observations with an NA using na.omit(). (This is less relevant for our dataset, as we do not have NA values in this subset).

survey_data <- na.omit(survey_data)