gganimintproto is inspired by the proto package, but it has some important differences. Notably, it cleanly supports cross-package inheritance, and has faster performance.
gganimintproto(`_class` = NULL, `_inherit` = NULL, ...) gganimintproto_parent(parent, self)
Class name to assign to the object. This is stored as the class
attribute of the object. If
gganimintproto object to inherit from. If
A list of members in the gganimintproto object.
Access parent class
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
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.
To explicitly call a methods in a parent, use
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.