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_fill_gradientn()
Examples
# Gets the scores of União da Ilha 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 = "União da Ilha do Governador",
criterions = "BATERIA")
#> Warning: Your selection does not contains: 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1982, 1983, 1984, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
# Loads ggplot2
library(ggplot2)
# Creates a plot and applies the palette of União da Ilha
df |>
ggplot(aes(x = year, y = score, fill = score)) +
geom_point(color = "black", shape = 21, size = 2) +
scale_fill_rio_c("Uniao_Ilha")