Get startedGet started for free

Storyboards

Let's turn our dashboard into a storyboard.

This exercise is part of the course

Building Dashboards with flexdashboard

View Course

Exercise instructions

  • Change the header so the dashboard is presented in storyboard format.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

{"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(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### 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\ntrips_df %>%\n  filter(bike_number == trips_per_bike_df$bike_number[1]) %>%\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"}
Edit and Run Code