| new_generator | R Documentation |
A generator draws a value together with an integrated tree of smaller values.
new_generator() is the extension point for custom generators. Its draw
function receives a non-negative integer size and returns one value. Its
deterministic shrink function returns a list of strictly smaller values.
The custom shrinker constructs that list itself; the framework constructs
and transforms the corresponding tree nodes only as they are visited.
new_generator(
draw,
shrink = function(value) list(),
label = "custom",
prototype = list()
)
draw |
Function of one |
shrink |
Function of one generated value that returns a list of smaller values. |
label |
Short description used in diagnostics. |
prototype |
Zero-length prototype used by |
An S7 generator object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.