Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansam committed May 27, 2024
1 parent e2680aa commit 5630dd5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/palettes.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gameR_colors <- list(
kirby = c("#ffa8dc", "#c21f24", "#4fd644"),
ocarina = c("#02940a", "#4f4499", "#e2e844", "#e94117"),
okami = c("#56735a", "#f27934", "#c8e7e3", "#e2afb3", "#bfb582"),
p3r = c("#00a9f0", "#0768c0", "#e01d2f", "#000116", "#7dd22c"),
p3r = c("#00a9f0", "#0768c0", "#e01d2f", "#000116", "#7bbf34"),
p4g = c("#ffe52c", "#7fe6ef", "#faa622", "#c4d70c", "#c22303"),
pman = c("#fffd54", "#e93423", "#5acafa", "#f3aa3c", "#f2acda"),
rayman = c("#945682", "#fcb24c", "#be3b45"),
Expand Down
Binary file modified man/figures/README-unnamed-chunk-15-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions vignettes/gameR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ data("penguins")
```

Here, we use the `penguins` dataset from the `{palmerpenguins}` package to
provide simple examples of how gameR can be used to customize a plot using either `{ggplot2}` or base R. We will plot a scatter plot of flipper length (in mm) against body mass (in g) with the points colored by species.
provide simple examples of how gameR can be used to customize a plot using
either `{ggplot2}` or base R. We will plot a scatter plot of flipper length (in
mm) against body mass (in g) with the points colored by species.

## Using `{ggplot2}`

To use palettes from gameR in ggplots, a palette can be specified via either
`scale_color_manual()` or `scale_fill_manual()` to adjust color or fill
respectively for variables specified in `aes()`. When specifying a palette, the `values =` argument must be used.
To use palettes from gameR in ggplot, a palette can be specified via either
`scale_color_manual()` or `scale_fill_manual()` to adjust the color or fill
respectively. When specifying a palette, the `values =` argument must be used.
Calling the `scale_*` function will not allow a palette to be specified if
no named argument is used.

Expand All @@ -46,7 +48,9 @@ penguins %>%

## Using base R

If base R plotting is being used, the `bg` argument can be used to specify the color of the points. Here we use `gameR_cols()` in combination with `unclasss()` to color by species.
If base R plotting is being used, the `bg` argument can be used to specify the
color of the points. Here we use `gameR_cols()` in combination with `unclasss()`
to color by species.

```{R}
par(bg = "white")
Expand Down

0 comments on commit 5630dd5

Please sign in to comment.