---
title: "Dashboard"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source: embed
---
```{r setup, include=FALSE}
library(tidyverse)
library(dplyr)
library(p8105.datasets)
library(plotly)
knitr::opts_chunk$set(
fig.width = 6,
fig.asp = .6,
out.width = "90%"
)
theme_set(theme_minimal() + theme(legend.position = "bottom"))
options(
ggplot2.continuous.colour = "viridis",
ggplot2.continuous.fill = "viridis"
)
scale_colour_discrete = scale_colour_viridis_d
scale_fill_discrete = scale_fill_viridis_d
library(flexdashboard)
```
```{r}
data("instacart")
```
```{r}
instacart =
instacart %>%
select(order_id, product_id, order_number, order_hour_of_day,product_name, department) %>%
filter(product_id <= 10)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
instacart %>%
plot_ly(x = ~product_name, y = ~order_hour_of_day, color = ~department,type = "scatter", mode = "markers")
```
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
```{r}
instacart %>%
plot_ly(x = ~product_name, y = ~order_hour_of_day, color = ~department,type = "box", colors = "viridis")
```
### Chart C
```{r}
instacart %>%
plot_ly(x = ~product_name, y = ~order_hour_of_day, color = ~department,type = "bar", colors = "viridis")
```