```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r message = FALSE}
library(tidyverse)
library(gapminder)
library(ggthemes)
```

## Static Images - Overlayed

```{r time-series-overlay, fig.align='center', out.width="80%"}
chosen_countries <- c("Philippines", "United States", "Japan")

df <- gapminder %>%
  # get only the chosen countries
  filter(country %in% chosen_countries) %>%
  # drop any rows with missing values
  drop_na()

# overlayed time-series plot
p1 <- ggplot(data = df, aes(x = year, y = gdpPercap, color = country)) +
  geom_point() + 
  geom_line() + 
  scale_colour_colorblind() +
  labs(x = "year",
       y = "GDP per Capita",
       title = "Yearly GDP per Capita")
p1
```

## Static Images - Separated

```{r time-series-separated, fig.align='center', out.width="80%"}
p1 + facet_wrap(~country, nrow=length(chosen_countries))
```


