knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(chart)

Introduction

In R, there are several plotting engines, but the three major ones are the base {graphics} package (here called "base plot"), {lattice} and {ggplot2}. Each of them has its own philosophy and syntax. The plots they produce have distinctive look, even if they can be tailored to different styles. The {chart} package provides a unified interface to these three plotting engines.

The goal of {chart} is:

{chart} for {ggplot2} users

The {chart} package uses {ggplot2} in priority. It is designed to be as close as possible to the {ggplot2} syntax with the following four exceptions:

  1. You should use chart() instead of ggplot(). The chat() function is backward compatible with ggplot() and you can use the same syntax, but it also uses an alternate formula-based interface. On the contrary to ggplot(), chart() automatically use labels and units for axes and legends, it uses a default style closer to a "publication-ready" format, and it is a generic function that provides different methods (and different plot types for each method).

  2. You can use a formula instead of an aes() to specify the aesthetics.



SciViews/chart documentation built on June 3, 2024, 7:26 a.m.