Column

Chart A

Column

Chart B

Chart C

---
title: "flexdashboard example"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(plotly)

df <- read_csv("./data/original/gapminder.csv")
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
# Using the plotly package and ggplotly to add basic interactivity

ggplot(df, aes(x = gdpPercap, y = lifeExp)) +
  geom_point(aes(color = continent)) +
  scale_x_log10()

ggplotly()
```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}
ggplot(df, aes(x = continent, y = lifeExp, fill = continent)) +
  geom_boxplot() +
  theme(
    legend.position = "none"
  )
```

### Chart C

```{r}
tmp <- df %>%
  group_by(continent, year) %>%
  summarize(lifeExp = mean(lifeExp))

ggplot(tmp, aes(x = year, y = lifeExp, color = continent)) +
  geom_line() +
  geom_point()
```