is_data_frame: Checks if the passed entity is a data frame.

View source: R/data_frame.R

is_data_frameR Documentation

Checks if the passed entity is a data frame.

Description

Checks if the passed entity is a data frame.

Usage

is_data_frame(
  df,
  exact_rownames = NULL,
  exact_colnames = NULL,
  required_rownames = NULL,
  required_colnames = NULL,
  allow_null = FALSE
)

Arguments

df

the entity that might be a data frame

exact_rownames

vector of strings that, if passed, add the requirement for the data frame to contain *exactly* the named rows. Note that if a name has NULL assigned to it, it counts as not present.

exact_colnames

as required_rownames, but for column names.

required_rownames

vector of strings that, if passed, add the requirement for the data frame to contain *at least* those named rows, respectively. Note that if a name has NULL assigned to it, it counts as not present. If exact_rownames is present, this option is ignored.

required_colnames

as required_rownames, but for column names

allow_null

if TRUE, NULL is accepted as a valid value. If FALSE (default) do not accept it.

Examples

## Not run: 
# For assertion
assertthat::assert_that(qscheck::is_data_frame(my_parameter))
# For check
if (qscheck::is_data_frame()) {}

## End(Not run)


AstraZeneca/qscheck documentation built on Nov. 1, 2023, 4:45 a.m.