class_schema: Schema: a class to hold list-like objects' schemas

Description Usage Arguments Details Value Slots The Schema class Using the class See Also

Description

A general container holding schemas. A schema dictates the structure (component names and prototypes) of a list-like R object.

Usage

 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)

Arguments

inputs

a named character of name = value pairs. Names are optional.

prototypes

a named list of name = value pairs. Values must be objects of class Prototype.

...

further arguments passed to or from methods.

object

a Schema object.

Details

The constructor Schema() is flexible in its name management.

Value

The constructor Schema() returns an object of class Schema.

The show() method returns NULL invisibly. It is used for its-effect.

Slots

inputs

a named character.

prototypes

a named list strictly containing objects of class Prototype. Names of both slots must match exactly.

The Schema class

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.

Using the class

See Also

Other Schema: Schema-accessors, Schema-coercions, Schema-extractors, Schema-methods, Schema-setops, Schema-validators, is_schema()


jeanmathieupotvin/cargo documentation built on Oct. 27, 2020, 5:22 p.m.