Skip to contents

A unit variant has no fields; a struct variant has named fields; a newtype variant holds one value of a struct, variant(of = GRanges).

Usage

variant(fields = list(), description = "", rules = list(), of = NULL)

Arguments

fields

Named list: The fields of a struct variant.

description

Character: What the variant is.

rules

A rule(), or a list of rule() calls, over the variant's fields.

of

Optional R8 struct type: The struct a newtype variant holds.

Value

An r8_variant.

Examples

variant(fields = list(
  gamma = field(type_double(exclusive_min = 0), description = "Kernel width.")
))
#> <r8 variant>
#>   gamma: double (0, Inf)