set_field: Set field metadata

Description Usage Arguments See Also Examples

Description

New properties are added and existing properties are replaced (or deleted if NULL). If set, properties override the defaults returned by get_field.

Usage

1
2
3
4
set_field(.data, name, type, format, title, description, rdfType, constraints,
  unit, ...)

set_field(.data) <- value

Arguments

.data

Object to modify (typically an atomic vector).

name

(character) Field name.

type

(character) Field type (see table-schema/types-and-formats).

format

(character) Field format (see table-schema/types-and-formats).

title

(character) Human-readable title.

description

(character) Human-readable description.

rdfType

(character) URI of an RDF class (see table-schema/rich-types).

constraints

(named list) See constraints.

unit

(character) Unit of measurement.

...

(name = value) Additional properties.

value

(named list) Field metadata (typically a call to field).

See Also

Other field functions: field, get_field, set_fields

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- set_field(
 Sys.Date(),
 name = "date_created",
 type = "date",
 format = "%Y-%m-%d"
)
get_field(x)
x <- Sys.Date()
set_field(x) <- field(name = "date_created", type = "date", format = "%Y-%m-%d")
get_field(x)

ezwelty/dpkg documentation built on May 30, 2019, 7:19 a.m.