Create a web page using R Markdown that features a map created with Leaflet.
Host your webpage on either GitHub Pages, RPubs, or NeoCities.
Your webpage must contain the date that you created the document, and it must contain a map created with Leaflet. We would love to see you show off your creativity!
By accessing the Open Data Malaysia, we can look the location of petrol station in Kuala Lumpur and Selangor area in Malaysia.
stesen_minyak <- read.csv("stesenminyakklselangor2.csv")
head(stesen_minyak)
## NO FEATURE.CODE FEATURE.NAME NAME TYPE
## 1 1 BJ0330 Petrol Station SHELL Sungai Pelek SHELL
## 2 2 BJ0330 Petrol Station ESSO Sungai Pelek PETRON
## 3 3 BJ0330 Petrol Station PETRONAS Tanjung Sepat PETRONAS
## 4 4 BJ0330 Petrol Station SHELL Tanjung Sepat SHELL
## 5 5 BJ0330 Petrol Station SHELL Sepang SHELL
## 6 6 BJ0330 Petrol Station PETRONAS Jalan Pekeliling PETRONAS
## STATE LAT LONG
## 1 Selangor 2.64223 101.716
## 2 Selangor 2.64567 101.721
## 3 Selangor 2.66152 101.562
## 4 Selangor 2.66714 101.538
## 5 Selangor 2.69124 101.752
## 6 Selangor 2.75828 101.725
Map of petrol station in Kuala Lumpur and Selangor area (Malaysia)
library(leaflet)
stesen_minyak %>%
leaflet() %>%
addTiles() %>%
addMarkers(clusterOptions = markerClusterOptions())
## Assuming "LONG" and "LAT" are longitude and latitude, respectively