CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Building Dashboards with shinydashboard

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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
___
Modifier et exécuter le code