शुरू करेंमुफ़्त में शुरू करें

वेब-फ्रेंडली फीचर्स एक्सप्लोर करें

आइए plotly को एक और ग्राफ़ के साथ आज़माएँ और इसकी इंटरएक्टिव फीचर्स को एक्सप्लोर करें.

यह अभ्यास पाठ्यक्रम का हिस्सा है

flexdashboard के साथ डैशबोर्ड बनाना

पाठ्यक्रम देखें

अभ्यास निर्देश

  • कोड को जैसे है वैसे ही Knit कीजिए, HTML व्यूअर को बड़ा करें, और बनने वाले प्लॉट को देखें.
  • Station Usage चार्ट में station_gg प्लॉट को वेब-फ्रेंडली बनाने के लिए ggplotly() का प्रयोग करें.
  • एक्सप्लोरेशन के लिए तैयार करने के लिए Knit करें और व्यूअर को expand करें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

{"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(lubridate)\nlibrary(ggplot2)\nlibrary(tidyverse)\nlibrary(plotly)\n\ntrips_df <- read_csv('https://assets.datacamp.com/production/course_6355/datasets/sanfran_bikeshare_joined_oneday.csv')\n```\n\nColumn \n-----------------------------------------------------------------------\n\n### Station Usage\n\n```{r}\n\nstation_df <- trips_df %>%\n  select(start_station_name, end_station_name) %>%\n  rename(Start = start_station_name, End = end_station_name) %>%\n  pivot_longer(cols = Start:End, names_to = 'Usage', values_to = 'Station')\n\nstation_gg <- ggplot(station_df,\n                     aes(x = Station, fill = Usage)) +\n                     geom_bar(position = 'stack') +\n                     theme_bw() +\n                     ylab('Trips') +\n                     xlab('') +\n                     theme(axis.text.x = element_text(angle = 45, hjust = 1))\n                \nstation_gg     \n\n```\n\n\n"}
कोड संपादित करें और चलाएँ