LoslegenKostenlos loslegen

Understanding plotly limitations

You have seen that some ggplot plots cannot be directly converted into a Plotly object. For instance, horizontally oriented boxplots plotted using ggplot2 cannot be converted directly to horizontally oriented plotly boxplots. Vertically oriented ggplot boxplots must be plotted before carrying out a coordinate flip.

In the following exercises, you will fix some Plotly plots, so that they render correctly. You will also see some limitations of Plotly.

The London Airbnb dataset has been stored as a data frame called listings, and the tidyverse and plotly libraries have been loaded for you.

Diese Übung ist Teil des Kurses

Building Dashboards with shinydashboard

Kurs anzeigen

Interaktive Übung

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

# Modify to obtain a set of vertical boxplots
boxplots <- listings %>%
  ggplot(aes(x=reviews_per_month, y=room_type)) +
  geom_boxplot() +
  theme_classic()

# Obtain a horizontal set of plotly boxplots
___
Code bearbeiten und ausführen