check_cols: Check Cols

Description Usage Arguments Details Value

View source: R/check-cols.R

Description

Checks the names and order of columns in data.

Usage

1
2
3
4
5
6
7
check_cols(
  data,
  colnames = NULL,
  exclusive = FALSE,
  ordered = FALSE,
  data_name = substitute(data)
)

Arguments

data

The data frame to check.

colnames

A character vector of the column names.

exclusive

A flag indicating whether data can include additional columns.

ordered

A flag indicating whether the order of the columns has to match.

data_name

A string of the name of data.

Details

By default (colnames = NULL) data must include at least one column. To check for no columns set colnames = character(0).

Value

Throws an informative error or returns an invisible copy of the data.


poissonconsulting/datacheckr documentation built on March 18, 2021, 10:37 a.m.