Get startedGet started for free

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.

This exercise is part of the course

Building Dashboards with shinydashboard

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample 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
___
Edit and Run Code