IPL Instagram Followers Comparison

The plot depicts various IPL (Indian Premier League) teams represented by their team logo and a pop-up specifying the team name and number of Instagram followers. The logos are placed at the location (latitude and longitude) of the home stadiums of these respective teams eg: Mumbai Indians’ logo is placed at the coordinates of the Wankhede Stadium.

The radius around the logos are indicative of the number of followers these teams have on Instagram. To make the plot more discernible, I have taken the approximate count of the number of million subscribers of each team and multiplied it by 15 as the radius and applied unique colors to each team.

library(leaflet)
## Warning: package 'leaflet' was built under R version 4.0.2
my_map <- leaflet() %>% 
  addTiles()



iconss<-iconList(
  
  mi_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Mumbai-Indians-Logo-PNG.png",
  iconWidth = 40, iconHeight=30
  
  
),
  kkr_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Kolkata-Knight-Riders-Logo-PNG.png",
  iconWidth = 30, iconHeight=50
),

dc_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Delhi-Daredevils-Logo-PNG.png",
  iconWidth = 20, iconHeight=20
),

rcb_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Royal-Challengers-Bangalore-Logo-PNG.png",
  iconWidth = 40, iconHeight=40
),

csk_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Chennai-Super-Kings-Logo-PNG.png",
  iconWidth = 40, iconHeight=40
),
rr_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Rajasthan-Royals-Logo-PNG.png",
  iconWidth = 20, iconHeight=20
),

srh_icon <- makeIcon(
  iconUrl = "https://www.searchpng.com/wp-content/uploads/2019/02/Sunrisers-Hyderabad-Logo-PNG-Image-1024x1024.png",iconWidth = 40, iconHeight=40
),

kxip_icon <- makeIcon(
  iconUrl = "http://www.pngall.com/wp-content/uploads/2017/04/Kings-XI-Punjab-Logo-PNG.png",
  iconWidth = 20, iconHeight=20
)




)
  
Followers=  c(4.6,1.6,1.2,3.6,4.2,1,1.4,1,2) *15 
latitudes=c(18.9389,22.5646,28.6379,12.9788,13.06278,26.8940,17.4065,30.6909)
longitudes=c(72.8258,88.3433,77.2432,77.5998,80.27944,75.8032,78.5505,76.7375)
Teams=c("Mumbai Indians <br/> <b>4.6M</b>","Kolkata Knight Riders<br/> <b>1.6M</b>","Delhi Capitals<br/> <b>1.2M</b>","Royal Challengers Bangalore<br/> <b>3.6M</b>","Chennai Super Kings<br/> <b>4.2M</b>","Rajasthan Royals<br/> <b>1M</b>","Sunrisers Hyderabad<br/> <b>1.4M</b>","Kings X1 Punjab<br/> <b>2M</b>")
colorsTeams=c("blue","purple","maroon","red","yellow","black","orange","green")
my_map %>% addMarkers(lat=latitudes,lng=longitudes,popup =Teams ,icon = iconss) %>% addCircleMarkers(lat = latitudes,lng = longitudes,radius=Followers,color =colorsTeams )