Adventures with R - Cricket Analysis (Clustering players based on ODI data)
Continuing on the Cricket Analysis Series I wanted to take a deep dive into Clustering. I have the ODI database and I thought it would be instructive to put the data to use The main guide I used can be found HERE This is an excellent guide to cluster analysis in R and I highly recommend it The main code can be found HERE The final output file can be found HERE The final Tableau public dashboard can be found HERE The code walk through is as ## Different packages that you need library(mclust) library(tidyverse) library(cluster) library(factoextra) library(data.table) library(reshape2) library(sqldf) setwd('C:/Training/R/CricketAnalysis/') myData <- read.csv("ODIData.csv") myData <- sqldf("select Player, sum(Runs) Runs, sum(Mins) Mins, sum(BF) BF, sum(Fours) Fours, sum(Sixes) Sixes, ((100 * sum(Runs))/sum(BF)) SR from myData group by Player") ## Removing players that score less than the me