class_definitions {ggplot2}R Documentation

Class definitions

Description

The S7 object oriented programming system requires class definitions. Here, we provide definitions of classes that are home to ggplot2.

S7 classes

A general advice the S7 package gives is to name class definition objects the same as the class name, which then becomes the constructor for the class. The classes listed below deviate from that advice for historical reasons, because some constructors like ggplot() are also S3 generics with methods. The have the class_-prefix to indicate their role.

Theme elements

The theme elements follow the advice of the S7 package that the class names are also the class definitions and constructors.

ggproto classes

The ggproto classes are S3 classes of the type environment that form the backbone of most systems in ggplot2 and are in particular crucial to the extension system.

S3 classes

Some simple classes remain S3, primarily because they aren't meant to be recycled into new classes.


[Package ggplot2 version 4.0.1 Index]