check_data2: Check Data2

Description Usage Arguments Details Value

View source: R/check-data2.R

Description

Checks a data frame's rows, columns, classes and values and key.

Usage

1
2
3
4
5
6
7
8
check_data2(
  data,
  values = NULL,
  min_row = 1,
  max_row = max_nrow(),
  key = character(0),
  data_name = substitute(data)
)

Arguments

data

The data frame to check.

values

A named list specifying the columns and their associated classes and values.

min_row

A count of the minimum number of rows.

max_row

A count of the maximum number of rows.

key

A character vector of the column names representing the key.

data_name

A string of the name of data.

Details

check_data2 enforces some constraints. By default it requires data to have rows (and therefore columns). It also does not allow NULLs in values and requires column names in values to be unique. However it does not require that data only includes the columns in value.

For stricter data checking see check_data3.

Value

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


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