bind_as_struct: Bind as Struct

View source: R/type_check.R

bind_as_structR Documentation

Bind as Struct

Description

Given a set of lists/dataframes, attempt to join them as a dataframe with field types matching the specified template. The default approach uses all fields present in the input lists, while the strict mode ensures that the template fields and only the template fields are present.

Usage

bind_as_struct(template, ..., .list = NULL, strict = FALSE)

Arguments

template

A named list to use as a template.

...

The lists to join

.list

A pre-built list of frames to join, as an alternative to .... Use exactly one of ... or .list.

strict

Use all and only the fields in the template. Default: FALSE

Value

A dataframe containing the combined inputs.

Examples

bind_as_struct(list("a" = character(0)), list("a" = 1), list("a" = "a"))

structenforcement documentation built on July 1, 2026, 5:07 p.m.