LoslegenKostenlos loslegen

Adding charts

In this exercise, you'll add content to one of your dashboard charts. Again, be sure to expand the HTML viewer after knitting your dashboard to see the whole page.

Diese Übung ist Teil des Kurses

Building Dashboards with flexdashboard

Kurs anzeigen

Anleitung zur Übung

  • Move the plot1 R chunk to the top chart in the second column.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

{"my_document.Rmd":"---\ntitle: \"Bikeshare\"\noutput: \n  flexdashboard::flex_dashboard\n---\n  \n```{r setup, include=FALSE}\nlibrary(flexdashboard)\nlibrary(readr)\nlibrary(ggplot2)\nlibrary(dplyr)\nlibrary(lubridate)\n```\n\n```{r load_data, include = FALSE}\ntrips_df <- read_csv('https://assets.datacamp.com/production/course_5875/datasets/sanfran_bikeshare_joined_oneday.csv')\n```\n\n```{r plot1}\n\ntrips_df %>%\n  mutate(Hour = hour(start_date)) %>%\n  group_by(Hour) %>%\n  summarize(`Trips Started` = n()) %>%\n  ggplot(aes(x = Hour, y = `Trips Started`)) +\n  theme_bw() +\n  geom_bar(stat = 'identity')\n\n```\n\nColumn\n-----------------------------------------------------------------------\n  \n### Chart A\n  \n```{r}\n\n```\n\nColumn\n-----------------------------------------------------------------------\n  \n### Chart B\n  \n```{r}\n\n```\n\n### Chart C\n\n```{r}\n\n```\n\n\n"}
Code bearbeiten und ausführen