Skip to contents

The facts of one column of type_table(): those of a field, and whether the column's values are distinct and whether every table holds it. A column that may be absent differs from a present column with missing cells, which is option(). A bare field type or a field() is the short form of a column that is required and not unique.

Usage

column(
  type,
  default = NULL,
  description = "",
  sensitive = FALSE,
  unit = NULL,
  unique = FALSE,
  required = TRUE,
  extensions = NULL
)

Arguments

type

An r8_field_type: The column's type, a scalar, a factor, or option() of one.

default

Optional: The default value.

description

Character: What the column holds.

sensitive

Logical: Mask the values in printing, events, errors, and differences.

unit

Optional Character: A unit code, by convention UCUM, such as "mg".

unique

Logical: The column's values are distinct.

required

Logical: Every table holds the column.

extensions

Optional named list: Namespaced extensions, which R8 stores and does not interpret.

Value

An r8_column.

Examples

type_table(list(
  id = column(type_character(), unique = TRUE),
  note = column(option(type_character()), required = FALSE)
))
#> <r8 field type> table with the columns id (character), note (optional character)