เพิ่มแผนที่ leaflet
มาเพิ่มแผนที่ลงในแดชบอร์ดโดยใช้ leaflet กัน
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การสร้างแดชบอร์ดด้วย flexdashboard
คำแนะนำการฝึกหัด
- ใช้คอลัมน์
stations_df$latitudeและstations_df$longitudeเพื่อเพิ่มแผนที่leafletที่แสดงตำแหน่งสถานีลงในชาร์ต Stations Map
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
{"my_document.Rmd":"---\ntitle: \"Bike Shares Daily\"\noutput: \n flexdashboard::flex_dashboard:\n orientation: columns\n vertical_layout: fill\n---\n\n```{r setup, include=FALSE}\nlibrary(flexdashboard)\nlibrary(readr)\nlibrary(tidyverse)\nlibrary(leaflet)\n\nstations_df <- read_csv('https://assets.datacamp.com/production/course_6355/datasets/stations_data.csv')\n```\n\n\nColumn {data-width=650}\n-----------------------------------------------------------------------\n\n### Stations Map\n\n```{r}\n\n```\n\n\n"}