cols_exist: Do One or More Columns Actually Exist?

cols_existR Documentation

Do One or More Columns Actually Exist?

Description

cols_exist() is a pipeline validation function that checks whether specified columns exist in the input data. It is inspired by pointblank::col_exists() but allows tidy selection of columns.

Usage

cols_exist(.data, ..., action = rlang::abort)

Arguments

.data

A data frame or data frame extension (e.g. a tibble)

...

<tidy-select> One or more columns from the data, separated by commas. These can be specified as unquoted names or using tidy selection helpers; if the latter, cols_exist() will check that at least one column matches each provided <tidy-select> expression.

action

The action to perform if one or more columns do not exist; one of abort() (the default), warn(), or inform().

Value

The input data frame


jesse-smith/coviData documentation built on Jan. 14, 2023, 11:08 a.m.