스토리보드 해설
이야기의 두 번째 부분에 대한 해설을 추가해 보아요.
이 연습은 강의의 일부입니다
flexdashboard로 대시보드 만들기
연습 안내
- 첫 번째 차트 앞에 있던 두 개의 불릿 문장을, 이야기 두 번째 부분에 대한 해설로 옮기세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
{"my_document.Rmd":"---\ntitle: \"Bike Shares Daily\"\noutput: \n flexdashboard::flex_dashboard:\n orientation: columns\n vertical_layout: fill\n storyboard: true\n---\n\n```{r setup, include=FALSE}\nlibrary(flexdashboard)\nlibrary(readr)\nlibrary(leaflet)\nlibrary(DT)\nlibrary(tidyverse)\nlibrary(lubridate)\nlibrary(plotly)\n\ntrips_df <- read_csv('https://assets.datacamp.com/production/repositories/1448/datasets/1f12031000b09ad096880bceb61f6ca2fd95e2eb/sanfran_bikeshare_joined_oneday.csv')\n```\n\n* Bike `r most_used_bike_df$bike_number[1]` made its first trip from `r most_used_bike_df$start_station_name[1]` and ended its day at `r most_used_bike_df$end_station_name[nrow(most_used_bike_df)]`.\n* Its longest trip was `r max(most_used_bike_df$duration_sec)/60` minutes long.\n\n### Most bikes are used only a few times, but a few are used a lot\n\n```{r}\n\ntrips_per_bike_df <- trips_df %>%\n group_by(bike_number) %>%\n summarize(n_trips = n()) %>%\n arrange(desc(n_trips)) \n\nbike_plot <- trips_per_bike_df %>%\n ggplot(aes(x = n_trips)) +\n geom_histogram(binwidth = 1) +\n ylab('') +\n xlab('Trips per bike') \n\nggplotly(bike_plot)\n\n```\n\n### Where did the most used bike go?\n\n```{r}\n\nmost_used_bike_df <- trips_df %>%\n filter(bike_number == trips_per_bike_df$bike_number[1])\n\nmost_used_bike_df %>%\n rename(latitude = start_latitude,\n longitude = start_longitude) %>%\n group_by(start_station_id, latitude, longitude) %>%\n count() %>%\n leaflet() %>%\n addTiles() %>%\n addMarkers()\n\n```\n\n\n"}