Learn R Programming

tidyllm (version 0.3.1)

field_chr: Define Field Descriptors for JSON Schema

Description

These functions create field descriptors used in tidyllm_schema() to define JSON schema fields. They support character, factor, numeric, and logical types.

Usage

field_chr(.description = character(0), .vector = FALSE)

field_fct(.description = character(0), .levels, .vector = FALSE)

field_dbl(.description = character(0), .vector = FALSE)

field_lgl(.description = character(0), .vector = FALSE)

Value

An S7 tidyllm_field object representing the field descriptor.

Arguments

.description

A character string describing the field (optional).

.vector

A logical value indicating if the field is a vector (default: FALSE).

.levels

A character vector specifying allowable values (for field_fct() only).

Examples

Run this code
field_chr("A common street name")
field_fct("State abbreviation", .levels = c("CA", "TX", "Other"))
field_dbl("House number")
field_lgl("Is residential")
field_dbl("A list of appartment numbers at the address",.vector=TRUE )

Run the code above in your browser using DataLab