Description Usage Arguments Details Value Slots The Schema class Using the class See Also
A general container holding schemas. A schema dictates the structure (component names and prototypes) of a list-like R object.
1 2 3 4 5 6 7 8 9 10 | Schema(inputs, prototypes, ...)
## S4 method for signature 'missing,missing'
Schema(inputs, prototypes)
## S4 method for signature 'character,list'
Schema(inputs = character(), prototypes = list())
## S4 method for signature 'Schema'
show(object)
|
inputs |
a named |
prototypes |
a named |
... |
further arguments passed to or from methods. |
object |
a |
The constructor Schema()
is flexible in its name management.
Names can be missing. Then, default matching tags are automatically generated.
Names can be passed to Schema()
only once through either inputs
or
prototypes
. In that case, they are reused elsewhere.
The constructor Schema()
returns an object of class Schema
.
The show()
method returns NULL
invisibly. It is used for its-effect.
inputs
a named character.
prototypes
a named list
strictly containing objects of class
Prototype
. Names of both slots must match exactly.
Class Schema
holds the structure of a dataset (a list-like object in R).
A Schema
consists of two things: inputs' names and prototypes. This is
enough to define what to expect from a list.
The Schema
class is mostly useful in any situation that requires formality:
automated applications, APIs, large-scale systems, different teams working
in parallel that must share work, etc.
Create objects of class Schema
through the constructor function Schema()
.
Validate instances of the class by using valid_schema()
.
Test objects for class Schema
with introspector function is_schema()
.
Extract slots from instances of the class with functions inputs()
and prototypes()
.
Set new values to slots with functions inputs<-()
,
and prototypes<-()
.
Subset instances of the class by using the Schema
methods implemented
for the operators [
, [[
and
$
.
Methods for class Schema
are implemented for generic functions
format()
, length()
, names()
and show()
.
Other Schema:
Schema-accessors
,
Schema-coercions
,
Schema-extractors
,
Schema-methods
,
Schema-setops
,
Schema-validators
,
is_schema()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.