rushing_kmeans_data <- vroom("http://nfl-book.bradcongelio.com/kmeans-data")
rusher_names <- rushing_kmeans_data$player
rusher_ids <- rushing_kmeans_data$player_id
rushers_pca <- rushing_kmeans_data |>
select(-player, -player_id)
rownames(rushers_pca) <- rusher_names
rushers_pca <- prcomp(rushers_pca, center = TRUE, scale = TRUE)
fviz_pca_biplot(rushers_pca, geom = c("point", "text"), ggtheme = nfl_analytics_theme()) +
xlim(-6, 3) + labs(title = "PCA Biplot: PC1 and PC2") +
xlab("PC1 - 35.8%") + ylab("PC2 - 24.6%")
On Chapter 5's first K-means plot, the PC2 data seems flipped with the example plot. On my plot, it shows Dalvin Cook with -3 PC2 but on your graph it shows Cook with +3 PC2. Was wondering why the data seems opposite for every player.