Schema-class: Schema

Schema-classR Documentation

Schema

Description

A Schema is an Entity that defines a set of columns in a table.

Format

An R6 class object.

Methods

  • Schema(name=NULL, columns=NULL, parent=NULL, properties=NULL, annotations=NULL, description=NULL): Constructor for Schema

  • addColumn(column): Adds a Column to the schema

  • addColumns(columns): Adds a list of Columns to the schema

  • has_columns(): Are there any Columns specified in the schema?

  • removeColumn(column): Removes a Column from the schema

Examples

## Not run: 
schema <- Schema(name='MyTable', parent=project)
schema$addColumn(Column(name='Isotope', columnType='STRING'))
cols <- c(Column(name='Atomic Mass', columnType='INTEGER'),
	Column(name='Halflife', columnType='DOUBLE'),
	Column(name='Discovered', columnType='DATE'))
schema$addColumns(cols)
schema$has_columns()
schema$removeColumn(Column(name='Discovered', columnType='DATE'))
schema <- synStore(schema)

## End(Not run)

Sage-Bionetworks/synapseclient documentation built on Feb. 9, 2024, 4:26 p.m.