---
title: "Recipes for Data Science"
format: html
---

# Comparing 3 numerical variables
```{r}
library(tidyverse)
library(plotly)

plot_ly(mpg, x = ~displ, y = ~hwy, z = ~cty, 
        type = 'scatter3d', mode = 'markers',
        marker = list(size = 5, color = ~cyl, colorscale = 'Viridis', showscale = TRUE)) %>%
  layout(scene = list(xaxis = list(title = 'Displacement'),
                      yaxis = list(title = 'Highway MPG'),
                      zaxis = list(title = 'City MPG')))
```