Main cities in New Zealand with main universities (not all).
Peer-graded assignment, https://www.coursera.org/learn/data-products/peer/NLn0H/r-markdown-and-leaflet
Published at: https://rpubs.com/Pascal/pa01_ddp
library(leaflet)
df <- data.frame(lat = c(-36.866670, -41.286640, -43.533330, -37.783330, -45.874160, -37.686110, -40.356360),
lng = c(174.766670, 174.775570, 172.633330, 175.283330, 170.503610, 176.166670, 175.611130),
pop = c(1534700, 412500, 396700, 235900, 120200, 137900, 85300),
uni = c("University of Aukland", "Victoria University Wellington", "University of Canterburry",
"University of Waikato", "University of Otago", "", "Massey University"),
uni_pop = c(33028, 17227, 12108, 10094, 18896, 0, 19074),
uni_lnk = c("<a href='http://www.auckland.ac.nz/'> Auckland University</a>",
"<a href='http://www.victoria.ac.nz/'> Victoria University of Wellington</a>",
"<a href='http://www.canterbury.ac.nz/'> University of Canterburry</a>",
"<a href='http://www.waikato.ac.nz/'> University of Waikato</a>",
"<a href='https://www.otago.ac.nz/'> University of Otago</a>",
"",
"<a href='http://www.massey.ac.nz/'></a>"
),
city = c("Auckland", "Wellington", "Christchurch", "Hamilton", "Dunedin", "Tauranga", "Palmerston North")
)
f <- 14
icons <- iconList(
makeIcon(
"icons/University_of_Auckland_Coat_of_Arms.png",
iconWidth = f*252/297, iconHeight = f,
iconAnchorX = f*252/297/2, iconAnchorY = f/2
),
makeIcon(
"icons/Vuw-shield.png",
iconWidth = f*325/310, iconHeight = f,
iconAnchorX = f*325/310/2, iconAnchorY = f/2
),
makeIcon(
"icons/University_of_Canterbury_Coat_of_Arms.png",
iconWidth = f*347/330, iconHeight = f,
iconAnchorX = f*347/330/2, iconAnchorY = f/2
),
makeIcon(
"icons/102px-University_of_Waikato_logo.svg.png",
iconWidth = f*102/118, iconHeight = f,
iconAnchorX = f*102/118/2, iconAnchorY = f/2
),
makeIcon(
"icons/University_of_Otago_logo.png",
iconWidth = f*300/280, iconHeight = f,
iconAnchorX = f*300/280/2, iconAnchorY = f/2
),
makeIcon(
"icons/43533.png", # No uni in Tauranga
iconWidth = 2, iconHeight = 2
),
makeIcon(
"icons/Massey_University_logo.png",
iconWidth = f*200/200, iconHeight = f,
iconAnchorX = f*200/200/2, iconAnchorY = f/2
)
)