field_chr {tidyllm} | R Documentation |
Define Field Descriptors for JSON Schema
Description
These functions create field descriptors used in tidyllm_schema()
or field_object()
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)
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 |
Value
An S7 tidyllm_field
object representing the field descriptor.
Examples
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 )
[Package tidyllm version 0.3.4 Index]