gglgbtq

Provides multiple palettes based on pride flags with tailored themes.

https://github.com/turtletopia/gglgbtq

Science Score: 13.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
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary

Keywords

ggplot2 ggplot2-themes lgbt palettes pride pride-flags r
Last synced: 6 months ago · JSON representation

Repository

Provides multiple palettes based on pride flags with tailored themes.

Basic Info
Statistics
  • Stars: 23
  • Watchers: 1
  • Forks: 0
  • Open Issues: 12
  • Releases: 2
Topics
ggplot2 ggplot2-themes lgbt palettes pride pride-flags r
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---

```{r opts, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  fig.height = 1.6
)

library(gglgbtq)
options(gglgbtq_font_size = 1.7)
set.seed(7)
```

# gglgbtq 


[![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/gglgbtq)](https://CRAN.R-project.org/package=gglgbtq)
[![R-CMD-check](https://github.com/turtletopia/gglgbtq/workflows/R-CMD-check/badge.svg)](https://github.com/turtletopia/gglgbtq/actions)
[![Codecov test coverage](https://codecov.io/gh/turtletopia/gglgbtq/branch/master/graph/badge.svg)](https://app.codecov.io/gh/turtletopia/gglgbtq?branch=master)


gglgbtq provides multiple palettes based on flags in LGBTQ community. These palettes are accompanied by ggplot2 themes that maximize readability of each palette (especially of the white strip that is present in most flags).

## Installation

```{r install, eval = FALSE}
# Install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("turtletopia/gglgbtq")
```

## User guide

To list all available palettes, call:

```{r pride_head}
show_pride()
```

The most common use case is to use palettes with ggplot2:

```{r ggplot2, fig.height=3}
library(ggplot2)

data <- data.frame(
  group = rep(c("yes", "no", "maybe"), each = 3) |>
    as.factor(),
  x = rep(seq_len(3), times = 3),
  y = runif(3 * 3) + .5
)

ggplot(data, aes(x = x, y = y, fill = group)) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_lgbtq("pansexual")
```

Use matching `theme_lgbtq()` to make colors stand out the most:

```{r ggplot2_theme, fig.height=3}
ggplot(data, aes(x = x, y = y, fill = group)) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_lgbtq("pansexual") +
  theme_lgbtq("pansexual")
```

`theme_lgbtq()` passes additional parameters to `ggplot2::theme()`, so it's fully customizable:

```{r ggplot2_theme_custom, fig.height=3}
ggplot(data, aes(x = x, y = y, fill = group)) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_lgbtq("pansexual") +
  theme_lgbtq("pansexual", legend.position = "left")
```

Almost all ggplot2 uses of `palette_lgbtq()` will be with `color` and `fill` scales, so the `scale_color_lgbtq()` and `scale_fill_lgbtq()` functions provide a shorthand and more descriptive notation; there's nothing stopping you, however, from passing them manually or using in any other package, though the ggplot2 dependency might be a pretty large one.

```{r ggplot2_scale, fig.height=3}
ggplot(data, aes(x = x, y = y, fill = group)) +
  geom_bar(stat = "identity", position = "dodge") +
  scale_fill_manual(values = palette_lgbtq("pansexual")) +
  theme_lgbtq("pansexual", legend.position = "left")
```

## Gallery

Only a few most common palettes are included below. For the complete list, see [palette gallery vignette](https://turtletopia.github.io/gglgbtq/articles/gallery.html).

```{r palettes}
palette_lgbtq("rainbow")
palette_lgbtq("philadelphia")
palette_lgbtq("progress")
palette_lgbtq("lesbian")
# In its original meaning of "gay men"
palette_lgbtq("gay")
palette_lgbtq("bisexual")
# Background added to avoid the "disappearance" of the white stripe
print(palette_lgbtq("transgender"), background = "gray92")
palette_lgbtq("asexual")
palette_lgbtq("nonbinary")
palette_lgbtq("intersex")
```

## End notes

I believe in equal rights and treatment for everybody, regardless of their sexuality, gender identity, skin tone, nationality, and other features beyond human control. Thus, I do not allow gglgbtq to be used in any project that promotes hate based on the aforementioned factors.

Owner

  • Name: turtletopia
  • Login: turtletopia
  • Kind: organization
  • Location: Poland

GitHub Events

Total
  • Watch event: 7
Last Year
  • Watch event: 7

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 14
  • Total pull requests: 0
  • Average time to close issues: 11 months
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 0
  • Average comments per issue: 0.07
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ErdaradunGaztea (13)
  • thomasp85 (1)
Pull Request Authors
Top Labels
Issue Labels
enhancement (10) bug (1) tests (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 211 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: gglgbtq

Show Pride on 'ggplot2' Plots

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 211 Last month
Rankings
Stargazers count: 18.7%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 37.2%
Downloads: 73.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • ggplot2 * imports
  • grDevices * imports
  • graphics * imports
  • spelling * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
.github/workflows/render-rmarkdown.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
  • r-lib/actions/setup-renv v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite