Check Cols

Share:

Description

Checks the names and order of columns in data.

Usage

1
2
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.

See Also

datacheckr