| Table | R Documentation |
Table class for working with tabular data and associated schema. A table is created from a data source and optionally a schema. It provides methods for iteration, reading, inference, validation, and saving of tabular data.
# Table$load(source, schema = NULL, strict = FALSE, headers = 1, ...)
source |
Data source. Can be one of:
|
schema |
Optional. Schema object or schema descriptor as JSON, list, or URL. |
strict |
Logical. If |
headers |
Data source headers. Can be:
|
... |
Additional options passed to the CSV parser.
See CSV Parser Options. By default, |
R6Class object.
Object of class R6Class.
Table$new(source, schema, strict, headers)Use Table$load to instantiate a Table object.
iter(keyed, extended, cast = TRUE, relations = FALSE, stream = FALSE)Iterates over table rows.
keyedLogical. Whether to return rows as named lists.
extendedLogical. Whether to include row metadata.
castLogical. Whether to cast data to schema types.
relationsList of foreign key references (named list of resource names with reference rows).
streamLogical. Return an R stream if TRUE.
read(keyed, extended, cast = TRUE, relations = FALSE, limit)Reads and returns the entire table as rows.
keyedLogical. Whether to return keyed rows.
extendedLogical. Whether to include row metadata.
castLogical. Whether to cast values.
relationsList of foreign key references (see iter).
limitInteger. Maximum number of rows to return.
infer(limit = 100)Infers the schema from the data.
limitInteger. Number of rows to use for inference.
save(target)Saves the table as a CSV file.
targetFile path to save to.
headersReturns headers detected or provided.
schemaReturns the associated Schema instance.
A table is a fundamental concept in tabular data management. It represents rows and columns of structured data, often accompanied by a schema (metadata describing field types, constraints, etc.).
The physical representation of a table refers to the raw data (e.g., in CSV or JSON form). The logical representation corresponds to the parsed and typed values conforming to schema definitions.
This class supports both representations, applying validation, constraint checking, and conversion between them.
Internally, the package uses:
jsonlite for JSON parsing to and from R lists.
future for asynchronous loading (e.g., future::value(future_obj)).
See the examples in function documentation for how to use these features with 'tableschema.r'.
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT,
SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL
in this documentation are interpreted as described in RFC 2119.
Table$load,
Table Schema Specifications
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.