nmfspalette
:art: R color palettes for NOAA Fisheries official colors
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
5 of 9 committers (55.6%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.5%) to scientific vocabulary
Keywords
color-palette
noaa
noaa-nsap
r
Keywords from Contributors
stock-synthesis
fisheries
fisheries-stock-assessment
interpretability
standardization
animal
hack
autograder
report
stock-assessment
Last synced: 6 months ago
·
JSON representation
Repository
:art: R color palettes for NOAA Fisheries official colors
Basic Info
- Host: GitHub
- Owner: nmfs-ost
- License: other
- Language: R
- Default Branch: main
- Homepage: https://nmfs-ost.github.io/nmfspalette/
- Size: 2.84 MB
Statistics
- Stars: 36
- Watchers: 5
- Forks: 10
- Open Issues: 2
- Releases: 6
Topics
color-palette
noaa
noaa-nsap
r
Created over 5 years ago
· Last pushed 7 months ago
Metadata Files
Readme
License
README.Rmd
---
output: github_document
---
```{r}
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# nmfspalette
[](https://github.com/nmfs-ost/nmfspalette/actions/workflows/call-r-cmd-check.yml)
[](https://github.com/nmfs-ost/nmfspalette/tree/badges)
An R color palette for `{ggplot2}` using NOAA Fisheries branding colors.
`{nmfspalette}` implements these [steps](https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2) to create a `{ggplot2}` compatible palette according to [NOAA Fisheries branding](https://drive.google.com/file/d/1lXHmfGWCj6pI_Dr3C-Dwcnf1pXOIOztp/view?usp=sharing) (NOAA internal only).
## Installation
You can install the development version of nmfspalette from [GitHub](https://github.com/) with:
```r
# install.packages("pak")
pak::pak("nmfs-ost/nmfspalette")
```
To load the package, use:
```{r}
#| message: false
library(nmfspalette)
```
## Contributing
We welcome contributions to `{nmfspalette}`. You are welcome to make any changes you would like on a fork and submit a pull request. For more substantial changes or to create a branch, please contact sophie.breitbart@noaa.gov (NOAA Affiliates only). We ask that all contributors adhere to The NOAA Fisheries Integrated Toolbox [code of conduct](https://github.com/nmfs-ost/Resources/blob/main/CONTRIBUTING.md).
## Usage
To learn how to use `nmfspalette`, please check out the [interactive `learnr` tutorial](https://connect.fisheries.noaa.gov/colors/).
Extract an interpolated color palette from the default "oceans" palette.
You can change the number of colors (10 shown below).
```{r}
#| label: default_pal
nmfs_palette("oceans")(10)
```
## Palettes
Use the `all_nmfs_palettes()` function to see all available palettes.
```{r}
#| label: all_pals
#| fig-height: 4
all_nmfs_palettes()
```
Use the `display_nmfs_palette()` function to see a specific palette.
### Main NOAA Fisheries palettes
These palettes contain 4 or 6 colors.
#### oceans
```{r}
#| label: displ_oceans
#| fig-height: 2
display_nmfs_palette("oceans", 6)
```
#### waves
```{r}
#| label: displ_waves
#| fig-height: 2
display_nmfs_palette("waves", 4)
```
#### seagrass
```{r}
#| label: displ_seagrass
#| fig-height: 2
display_nmfs_palette("seagrass", 4)
```
#### urchin
```{r}
#| label: displ_urchin
#| fig-height: 2
display_nmfs_palette("urchin", 4)
```
#### crustacean
```{r}
#| label: displ_crustacean
#| fig-height: 2
display_nmfs_palette("crustacean", 4)
```
#### coral
```{r}
#| label: displ_coral
#| fig-height: 2
display_nmfs_palette("coral", 4)
```
#### regional (discrete)
```{r}
#| label: displ_regional_web
#| fig-height: 2
display_nmfs_palette("regional", 6)
```
##### Alternative regional palettes
For some with color vision deficiency (C.V.D.), it may be difficult to discern the colors in the regional palette. We have provided two alternative regional palettes, below.
*Note*: The alternative palette 1 contains colors that are entirely within the NMFS brand color set; alternative palette 2 does not. However, the colors in alternative palette 1 may be less distinguishable for all types of color perception as opposed to alternative palette 2.
```{r, fig.height = 2, displ_regional_web2}
nmfspalette::display_nmfs_palette("regional_alt1", 6)
```
```{r, fig.height = 2, displ_regional_web3}
nmfspalette::display_nmfs_palette("regional_alt2", 6)
```
### NOAA Fisheries complementary colors
These 5 palettes contain 4 complementary colors each and are identical to the main NOAA Fisheries palettes, but some colors have different names. Check out the [nmfs_cols.R file](https://github.com/nmfs-ost/nmfspalette/blob/main/R/nmfs_cols.R) for more information.
### NOAA Fisheries background & tint colors
These palettes contain 4 colors.
#### background sky
```{r}
#| label: displ_background_sky
#| fig-height: 2
display_nmfs_palette("background_sky", 4)
```
#### background green
```{r}
#| label: displ_background_green
#| fig-height: 2
display_nmfs_palette("background_green", 4)
```
#### background gray
```{r}
#| label: displ_background_gray
#| fig-height: 2
display_nmfs_palette("background_gray", 4)
```
### NOAA core colors (Fisheries version)
This palette contains 11 colors.
```{r}
#| label: displ_core
#| fig-height: 2
display_nmfs_palette("core", 11)
```
### NOAA alert colors
These palettes contain 4 colors.
#### alert red
```{r}
#| label: displ_alert_red
#| fig-height: 2
display_nmfs_palette("alert_red", 4)
```
#### alert orange
```{r}
#| label: displ_alert_orange
#| fig-height: 2
display_nmfs_palette("alert_orange", 4)
```
#### alert yellow
```{r}
#| label: displ_alert_yellow
#| fig-height: 2
display_nmfs_palette("alert_yellow", 4)
```
#### alert green
```{r}
#| label: displ_alert_green
#| fig-height: 2
display_nmfs_palette("alert_green", 4)
```
## Examples
In addition to `nmfs_palette` and `display_nmfs_palette` to get palettes, you can extract colors by name. Please see the [NOAA Fisheries Branding guide](https://drive.google.com/file/d/1lXHmfGWCj6pI_Dr3C-Dwcnf1pXOIOztp/view?usp=sharing) (NOAA internal only) for color names. Here, for most color names, underscores are used in place of spaces. Colors defined before 2023 have no spaces in the color names.
```{r}
#| label: nmfs_cols
nmfs_cols("vivid_crustacean")
nmfs_cols("processblue")
```
To use the palettes with `{ggplot2}`, the `scale_color_nmfs()` and `scale_fill_nmfs()` functions are provided. If no argument is given to `scale_color_nmfs()`, a default ("oceans") is used:
```{r}
#| label: default_plot
#| fig-height: 3
library(ggplot2)
p <- ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point(size = 4) +
scale_color_nmfs()
p
```
`scale_fill_nmfs()` does not have a default and therefore requires a named argument, this is an example using the "crustacean" palette:
```{r}
#| label: scale_fill_example
#| fig-height: 3
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
scale_fill_nmfs(palette = "crustacean", discrete = FALSE, reverse = TRUE)
```
------------------------------------------------------------------------
## Disclaimer
“The United States Department of Commerce (DOC) GitHub project code is provided on an ‘as is’ basis and the user assumes responsibility for its use. DOC has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any claims against the Department of Commerce stemming from the use of its GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.”
------------------------------------------------------------------------
[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/)
Owner
- Name: Office of Science & Technology at NOAA Fisheries
- Login: nmfs-ost
- Kind: organization
- Website: https://www.fisheries.noaa.gov/about/office-science-and-technology
- Repositories: 2
- Profile: https://github.com/nmfs-ost
Providing the science behind how we manage sustainable fisheries, protected species, and healthy ecosystems.
GitHub Events
Total
- Create event: 12
- Release event: 1
- Issues event: 2
- Watch event: 6
- Delete event: 10
- Issue comment event: 19
- Push event: 45
- Pull request review event: 28
- Pull request review comment event: 35
- Pull request event: 24
- Fork event: 2
Last Year
- Create event: 12
- Release event: 1
- Issues event: 2
- Watch event: 6
- Delete event: 10
- Issue comment event: 19
- Push event: 45
- Pull request review event: 28
- Pull request review comment event: 35
- Pull request event: 24
- Fork event: 2
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| ChristineStawitz-NOAA | c****z@n****v | 93 |
| sbreitbart-NOAA | s****t@n****v | 21 |
| Bai Li | b****i@n****v | 21 |
| Kathryn Doering | k****g@n****v | 16 |
| github-actions[bot] | 4****] | 12 |
| corinne.bassin | c****n@n****v | 1 |
| Nicholas Tierney | n****y | 1 |
| Julie Rose | 1****A | 1 |
| Haley Oleynik | 7****A | 1 |
Committer Domains (Top 20 + Academic)
noaa.gov: 5
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 15
- Total pull requests: 54
- Average time to close issues: 4 months
- Average time to close pull requests: 5 days
- Total issue authors: 8
- Total pull request authors: 7
- Average comments per issue: 1.47
- Average comments per pull request: 0.59
- Merged pull requests: 48
- Bot issues: 0
- Bot pull requests: 33
Past Year
- Issues: 5
- Pull requests: 30
- Average time to close issues: 3 months
- Average time to close pull requests: 3 days
- Issue authors: 3
- Pull request authors: 5
- Average comments per issue: 2.2
- Average comments per pull request: 1.0
- Merged pull requests: 27
- Bot issues: 0
- Bot pull requests: 19
Top Authors
Issue Authors
- k-doering-NOAA (4)
- ChristineStawitz-NOAA (3)
- okenk (1)
- iantaylor-NOAA (1)
- haleyoleynik (1)
- DanielDaye-NOAA (1)
- kellijohnson-NOAA (1)
- ericward-noaa (1)
- sbreitbart-NOAA (1)
Pull Request Authors
- github-actions[bot] (43)
- sbreitbart-NOAA (10)
- k-doering-NOAA (7)
- Bai-Li-NOAA (4)
- njtierney (2)
- ChristineStawitz-NOAA (1)
- julierose-NOAA (1)
Top Labels
Issue Labels
enhancement (3)
question (1)
Pull Request Labels
enhancement (1)
Dependencies
DESCRIPTION
cran
- ggplot2 * imports
- dplyr * suggests
- testthat * suggests