Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gganimintproto

Create a new gganimintproto object


Description

gganimintproto is inspired by the proto package, but it has some important differences. Notably, it cleanly supports cross-package inheritance, and has faster performance.

Usage

gganimintproto(`_class` = NULL, `_inherit` = NULL, ...)

gganimintproto_parent(parent, self)

Arguments

_class

Class name to assign to the object. This is stored as the class attribute of the object. If NULL (the default), no class name will be added to the object.

_inherit

gganimintproto object to inherit from. If NULL, don't inherit from any object.

...

A list of members in the gganimintproto object.

parent, self

Access parent class parent of object self.

Calling gganimintproto methods

gganimintproto methods can take an optional self argument: if it is present, it is a regular method; if it's absent, it's a "static" method (i.e. it doesn't use any fields).

Imagine you have a gganimintproto object Adder, which has a method addx = function(self, n) n + self$x. Then, to call this function, you would use Adder$addx(10) – the self is passed in automatically by the wrapper function. self be located anywhere in the function signature, although customarily it comes first.

Calling methods in a parent

To explicitly call a methods in a parent, use gganimintproto_parent(Parent, self).


animint2

Animated Interactive Grammar of Graphics

v2020.9.18
GPL-3
Authors
Toby Hocking [aut, cre] (Original animint code), Hadley Wickham [aut] (Forked ggplot2 code), Winston Chang [aut] (Forked ggplot2 code), RStudio [cph] (Forked ggplot2 code), Nicholas Lewin-Koh [aut] (hexGrob), Martin Maechler [aut] (hexGrob), Randall Prium [aut] (cut_width), Susan VanderPlas [aut] (Animint GSOC 2013), Carson Sievert [aut] (Animint GSOC 2014), Kevin Ferris [aut] (Animint GSOC 2015), Jun Cai [aut] (Animint GSOC 2015), Faizan Khan [aut] (Animint GSOC 2016-2017), Vivek Kumar [aut] (Animint GSOC 2018), Himanshu Singh [aut] (Animint2 GSoC 2020)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.