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:
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:
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).
You can use a formula instead of an aes()
to specify
the aesthetics.