Function for using RioPalettes colors schemes in ggplot2
. Use
scale_color_rio_d()
and scale_fill_rio_d()
for discrete scales and
scale_color_rio_c()
and scale_fill_rio_c()
for continuous scales.
Arguments
- palette_name
Name of Palette. Choices are:
Beija_Flor
,Grande_Rio
,Imperatriz_Leopoldinense
,Imperio_Serrano
,Mangueira
,Padre_Miguel
,Paraiso_Tuiuti
,Portela
,Salgueiro
,Sao_Clemente
,Tijuca
,Uniao_Ilha
,Vila_Isabel
,Viradouro
.- direction
Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed
- ...
Other arguments passed on to
ggplot2::scale_color_gradientn()
Examples
# Gets the scores of Salgueiro from 1968 until 2018 on the Bateria criterion.
# Throws some warnings to inform the user which years are absent of the data
# (either from missing info or because the school didn't compete in the main league)
df <- get_scores(years = 1968:2018,
schools = "Acadêmicos do Salgueiro",
criterions = "BATERIA")
#> Warning: Your selection does not contains: 1982, 1983, 1984
# Loads ggplot2
library(ggplot2)
# Creates a plot and applies the palette of Salgueiro
df |>
ggplot(aes(x = year, y = score, color = score)) +
geom_point() +
scale_color_rio_c("Salgueiro")