---
title: "Comp/Stat 112: Introduction to Data Visualization"
author: "INSERT STUDENT NAME HERE (COLLABORATOR NAMES HERE)"
output:
  bookdown::html_document2:
    split_by: none
    toc: yes
    toc_depth: 3
    toc_float:
      toc_collapsed: true
    number_sections: false
---

```{r 02_setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, error = TRUE)
library(tufte)
library(tidyverse)
library(ggplot2)
library(ggmap)
library(tint)
library(mosaic)
```

## Working through a ggplot example

```{r echo=FALSE,message=FALSE}
set.seed(102)
require(NHANES)
n <- 75
Tmp <-
  NHANES %>%
  mutate(
    smoker = derivedFactor(
      never = Smoke100 == "No",
      former = SmokeNow == "No",
      current = SmokeNow == "Yes",
      .ordered = TRUE
    ),
    sbp = BPSysAve,
    dbp = BPDiaAve,
    sex = Gender
  ) %>%
  select(sbp, dbp, sex, smoker) %>%
  sample_n(n) %>%
  filter(complete.cases(.)) %>%
  data.frame()
```