assert_many2one: Assert that data contain many-to-one or one-to-one map...

View source: R/assert_many2one.R

assert_many2oneR Documentation

Assert that data contain many-to-one or one-to-one map between columns

Description

assert_many2one checks whether there is a many-to-one map between two columns x and y of a data frame .data, raising an error if not and returning .data otherwise. assert_one2one checks for a one-to-one map. Both functions are intended for use in pipes.

Usage

assert_many2one(.data, x, y, na.rm = T)

assert_one2one(.data, x, y, na.rm = T)

Arguments

.data

A data frame or tibble.

x, y

Columns intended to share a many-to-one or one-to-one map.

na.rm

Should NA values be ignored? Default is TRUE.


bldavies/bldr documentation built on March 29, 2024, 10:22 a.m.