| register_json_coercion | R Documentation |
Registers a (predicate, handler) pair used by safe_to_json(): when
predicate(x) is TRUE, x is replaced by handler(x) before
serialization. Intended for companion packages (e.g. aisdk.datatools)
to teach the core serializer about extra object types from their .onLoad
hook, e.g. ggplot objects.
register_json_coercion(predicate, handler, id = NULL)
predicate |
A function taking an object and returning a single logical. |
handler |
A function taking an object and returning a serializable value. |
id |
Optional unique id; re-registering the same id replaces the handler. |
Invisibly TRUE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.