tspec_combine: Combine multiple specifications

View source: R/spec_combine.R

tspec_combineR Documentation

Combine multiple specifications

Description

Combine specifications created by tspec_df(), tspec_row(), or tspec_object(). The resulting specification includes all fields from the input specifications.

Usage

tspec_combine(...)

Arguments

...

(tspec) Specifications to combine.

Details

If a field is specified in multiple input specifications, the field specifications will be combined to produce a single field specification, using the most specific specification for each argument. See the examples for details.

Value

A tibblify specification.

Examples

# union of fields
tspec_combine(
  tspec_df(tib_int("a")),
  tspec_df(tib_chr("b"))
)

# unspecified + x -> x
tspec_combine(
  tspec_df(tib_unspecified("a")),
  tspec_df(tib_int("a"))
)

# scalar + vector -> vector
tspec_combine(
  tspec_df(tib_chr("a")),
  tspec_df(tib_chr_vec("a"))
)

# scalar/vector + variant -> variant
tspec_combine(
  tspec_df(tib_chr("a")),
  tspec_df(tib_chr_vec("a")),
  tspec_df(tib_variant("a"))
)

tibblify documentation built on May 9, 2026, 5:07 p.m.