Package 'onsvplot'

Title: National Road Safety Observatory (ONSV) Style for 'ggplot2' Graphics
Description: Helps to create 'ggplot2' charts in the style used by the National Road Safety Observatory (ONSV). The package includes functions to customize 'ggplot2' objects with new theme and colors.
Authors: Pedro Augusto Borges Santos [aut, cre] , ONSV - National Road Safety Observatory [cph, fnd]
Maintainer: Pedro Augusto Borges Santos <[email protected]>
License: MIT + file LICENSE
Version: 0.5.1
Built: 2024-11-05 02:56:46 UTC
Source: https://github.com/pabsantos/onsvplot

Help Index


ONSV Color Palette

Description

A list including the hex code of each color used in ONSV style

Usage

onsv_palette

Format

onsv_palette

A list with 12 colors: blue, yellow, red, green, pink, orange, lightblue, lightyellow, lightred, lightgreen, lightpink, lightorange, lightblue

Source

https://www.onsv.org.br/


Apply ONSV color scale to ggplot object

Description

scale_discrete_onsv() is used to apply the ONSV color scale to a ggplot graphics

Usage

scale_discrete_onsv(...)

Arguments

...

Arguments passed on to scale_discrete_manual or to discrete_scale, on a lower level.

Value

A custom scale object for ggplot objects

Examples

library(ggplot2)

ggplot(data = iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) +
  geom_point() +
  theme_onsv() +
  scale_discrete_onsv()

Apply ONSV theme to ggplot object

Description

theme_onsv() is used to apply the ONSV theme to a ggplot graphics.

Usage

theme_onsv(base_size = 11, ...)

Arguments

base_size

A number to define font base size, passed to theme_minimal

...

Arguments passed on to theme

Value

A custom theme() object.

Examples

library(ggplot2)

ggplot(data = iris, aes(x = Sepal.Width, y = Sepal.Length)) +
  geom_point() +
  theme_onsv()