assertcols: Validation and schema helpers

View source: R/helpers-assert.R

assertcolsR Documentation

Validation and schema helpers

Description

Low-level helpers for validating columns and keys or comparing schemas.

Usage

assertcols(data, cols)

commonnames(x, y)

duplicatedkeys(data, by)

assertkey(data, by)

Arguments

data, x, y

A data.frame.

cols

Column names or selectors, as accepted by the verbs.

by

Character vector of column names identifying groups or join keys.

Value

assertcols() and assertkey() return data invisibly or signal an error; commonnames() returns the shared column names; duplicatedkeys() returns the key combinations that occur more than once.

Examples

commonnames(mtcars, iris)
assertcols(mtcars, c("mpg", "hp"))
duplicatedkeys(data.frame(id = c(1, 1, 2)), "id")

basetable documentation built on Nov. 14, 2026, 1:08 a.m.