DataVizR

Prerequisites

It is mandatory to install Europace fronts beforehand.

Installation

# install.packages("devtools")
devtools::install_github("deadhand7/data-viz-r")
library(tidyverse)
library(DataVizR)

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/",
  warning = FALSE,
  message = FALSE
)

Overview

The package provides a palette based on Europace color codes and a custom theme which uses the Europace fronts. Additionally, some flexible quick-access plotting functions are included.

Main Functions

Customize an existing ggplot

iris %>% 
  ggplot(aes(x = Species, y = Sepal.Width, fill = Species)) +
  geom_violin() +
  scale.fill.ep('cool') +
  ep.theme()

Histogram

plot.histogram(df = mtcars, x = mpg, binwidth = 1, ticks = 5)  

Facets

DataVizR::plot.histogram(df = iris, x = Petal.Width, binwidth = 1, facet = Species, ticks = 3)  

Density Plot

plot.density(df = mtcars, x = qsec)  

Box-Plot

plot.boxplot(df = iris, x = Species, y = Sepal.Length, fill = Species, x.lab = 'Species', ticks = 4)


deadhand7/data-viz-r documentation built on Nov. 22, 2019, 3:12 p.m.