The rainbowr
package generates LGBT pride flags overlaid with the R
logo
The package can be installed from GitHub with:
# install.packages("devtools")
devtools::install_github("djnavarro/rainbowr")
library(magick)
#> Linking to ImageMagick 6.9.10.23
#> Enabled features: fontconfig, freetype, fftw, lcms, pango, webp, x11
#> Disabled features: cairo, ghostscript, rsvg
library(rainbowr)
#> 🌈
rainbow_flag <- make_banner("rainbow")
plot(rainbow_flag)
trans_flag <- make_banner("transgender")
plot(trans_flag)
The flags are taken from the Wikipedia page for LGBT symbols and the Wikicommons page for Sexual identity symbols, but is not exhaustive. To see which flags are included:
list_flags()
#> [1] "agender" "aromantic" "asexual" "bear"
#> [5] "bisexual" "demiboy" "demigirl" "demisexual"
#> [9] "genderfluid" "genderqueer" "intersex" "lesbian"
#> [13] "lipstick_lesbian" "nonbinary" "pansexual" "philadelphia"
#> [17] "polyamory" "polysexual" "progress" "rainbow"
#> [21] "transgender" "twink"
rainbow_hex <- make_hex("rainbow")
plot(rainbow_hex)
trans_hex <- make_hex("transgender", palette = c("grey50", "black"))
plot(trans_hex)
df <- data.frame(
flag = c("rainbow", "transgender", "bisexual", "bear", "aromantic", "lesbian"),
palette1 = c("white", "grey80", "#ccccff", "grey30", "grey50", "grey50"),
palette2 = c("black", "black", "white", "brown", "black", "lavender"),
row = c(1, 1, 2, 3, 3, 2),
col = c(1, 2, 1, 2, 3, 3),
stringsAsFactors = FALSE
)
hextile <- make_hextile(df)
#> adding rainbow hex (1 of 6)
#> adding transgender hex (2 of 6)
#> adding bisexual hex (3 of 6)
#> adding bear hex (4 of 6)
#> adding aromantic hex (5 of 6)
#> adding lesbian hex (6 of 6)
plot(hextile)