-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
54 lines (38 loc) · 1.8 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# palettehelper <img src="man/figures/logo.png" align="right" width=250 />
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/palettehelper)](https://CRAN.R-project.org/package=palettehelper)
<!-- badges: end -->
The goal of `palettehelper` is to help you build and manage color palettes in R for data viz. I mostly made it for myself! And as a test package for customizing content in the Fisheries Integrated Toolbox documentation.
## Installation
You can install the development version of `palettehelper` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("MargaretSiple-NOAA/palettehelper")
```
## Example
Expand the very beautiful (but short) color palettes from your favorite palette package.
```{r example}
library(RColorBrewer)
library(palettehelper)
pal <- RColorBrewer::brewer.pal(n = 6,name = "PuBuGn")
longer_pal <- palettehelper::lengthen_pal(shortpal = pal, newlength = 20)
print(longer_pal)
par(mfrow=c(1,2))
scales::show_col(pal)
scales::show_col(longer_pal)
```
<img src="https://raw.githubusercontent.com/nmfs-fish-tools/nmfspalette/main/man/figures/noaa-fisheries-rgb-2line-horizontal-small.png" height="75" alt="NOAA Fisheries Logo">
[U.S. Department of Commerce](https://www.commerce.gov/) | [National Oceanographic and Atmospheric Administration](https://www.noaa.gov) | [NOAA Fisheries](https://www.fisheries.noaa.gov/)