tribe_colours {survivoR} | R Documentation |
Tribe colours
Description
A dataset containing the tribe colours for each season
Usage
tribe_colours
Format
This data frame contains the following columns:
version
Country code for the version of the show
version_season
Version season key
season_name
The season name
season
The season number
tribe
Tribe name
tribe_colour
Colour of the tribe
tribe_status
Tribe status e.g. original, swapped or merged. In the instance where a tribe is formed at the swap by splitting 2 tribes into 3, the 3rd tribe will be labelled 'swapped'
Source
https://survivor.fandom.com/wiki/Tribe
Examples
library(ggplot2)
library(dplyr)
library(forcats)
df <- tribe_colours %>%
group_by(season_name) %>%
mutate(
xmin = 1,
xmax = 2,
ymin = 1:n(),
ymax = ymin + 1
) %>%
ungroup() %>%
mutate(
season_name = fct_reorder(season_name, season),
font_colour = ifelse(tribe_colour == "#000000", "white", "black")
)
ggplot() +
geom_rect(data = df,
mapping = aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax),
fill = df$tribe_colour) +
geom_text(data = df,
mapping = aes(x = xmin+0.5, y = ymin+0.5, label = tribe),
colour = df$font_colour) +
theme_void() +
facet_wrap(~season_name, scales = "free_y")
[Package survivoR version 2.3.4 Index]