Skip to content

Commit

Permalink
more typos
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakethompson committed Feb 9, 2024
1 parent 7102073 commit a4316e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions vignettes/palettes.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Using and creating color palettes"
output: rmarkdown::html_vignette
description: |
The plots were in screaming color.
vignette: >
Expand All @@ -11,11 +12,11 @@ vignette: >
```{r, child="children/chunk-options.txt"}
```

The taylor package comes with it's own class of color palettes, inspired by the work of [Josiah Parry](https://twitter.com/josiahparry) in the [{cpcinema}](https://github.com/JosiahParry/cpcinema) package.
The taylor package comes with it's own class of color palettes, inspired by the work of [Josiah Parry](https://twitter.com/josiahparry) in the [cpcinema](https://github.com/JosiahParry/cpcinema) package.

## Creating palettes

taylor uses [{vctrs}](https://vctrs.r-lib.org/) to create a special vector class of color palettes that can be used to create and visualize palettes. We can create a palette using the `color_palette()` function. We only have to pass a vector of hexadecimal values or valid R color (from `colors()`), and a palette is created that will print a preview of the colors.
taylor uses [vctrs](https://vctrs.r-lib.org/) to create a special vector class of color palettes that can be used to create and visualize palettes. We can create a palette using the `color_palette()` function. We only have to pass a vector of hexadecimal values or valid R color (from `colors()`), and a palette is created that will print a preview of the colors.

```{r}
library(taylor)
Expand Down Expand Up @@ -84,7 +85,7 @@ ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
theme_minimal()
```

Finally, if we have a discrete scale, we can use `ggplot2::scale_fill_manual()` or `ggplot2::scale_color_manual()`. Here, we use the [{palmerpenguins}](https://allisonhorst.github.io/palmerpenguins) to map our palette to the species of penguin.
Finally, if we have a discrete scale, we can use `ggplot2::scale_fill_manual()` or `ggplot2::scale_color_manual()`. Here, we use the [palmerpenguins](https://allisonhorst.github.io/palmerpenguins) to map our palette to the species of penguin.

```{r message = FALSE, warning = FALSE, fig.alt = "A scatter plot with bill length on the x-axis and bill depth on the y-axis. The shape and color of the points correspond to the species of penguin, with colors derived from our custom color palette. Adelie penguins are shown in red circles, Chinstrap penguins in yellow triangles, and Gentoo penguins in blue squares."}
library(palmerpenguins)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/plotting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The `album` argument can be changed to use a different Taylor-inspired palette.
p + scale_fill_taylor_d(album = "Speak Now")
```

We can also use these functions for non-Taylor Swift data. For example, here we use `scale_color_taylor_d()` to plot some data from the [{palmerpenguins}](https://allisonhorst.github.io/palmerpenguins) package.
We can also use these functions for non-Taylor Swift data. For example, here we use `scale_color_taylor_d()` to plot some data from the [palmerpenguins](https://allisonhorst.github.io/palmerpenguins) package.

```{r warning = FALSE, fig.alt = "A scatter plot with bill length on the x-axis and bill depth on the y-axis. The shape and color of the points correspond to the species of penguin, with colors derived from the color palette for Lover."}
library(palmerpenguins)
Expand Down

0 comments on commit a4316e8

Please sign in to comment.