---
title: "scale_duke_color_discrete()"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{scale_duke_color_discrete()}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 8,
  fig.asp = 0.618
)
```

This vignette is intended to demonstrate the functionality of `scale_duke_color_discrete()`. The function allows users to utilize a discrete color scale of Duke official branding colors on ggplot2 visualizations. 
It is fully integrated with ggplot2 visualizations.

# Plot Examples

For these visualizations, we will use the `penguins` dataset from the **palmerpenguins** package.

```{r penguins, warning = FALSE}
library(palmerpenguins)
library(duke)
library(ggplot2)
library(ggmosaic)
```

## Scatter Plot

```{r scatter plot, warning = FALSE}
plot <- ggplot(penguins, aes(x = bill_length_mm, y = bill_depth_mm)) +
  geom_point(aes(color = species)) +
  labs(
    title = "Bill Length vs. Bill Depth", 
    caption = "(Colors used) \n Duke Royal Blue, Duke Navy Blue, Copper", 
    x = "Bill Length (mm)", 
    y = "Bill Depth (mm)"
  )

plot +
  scale_duke_color_discrete()
```

## Jitter Plot

```{r jitter plot, warning = FALSE}
plot <- ggplot(penguins, aes(x = island, y = bill_depth_mm)) +
  geom_jitter(aes(color = species)) +
  labs(
    title = "Bill Length vs. Bill Depth", 
    caption = "(Colors used) \n Duke Royal Blue, Duke Navy Blue, Copper", 
    x = "Bill Length (mm)", 
    y = "Bill Depth (mm)"
  )

plot +
  scale_duke_color_discrete()
```

