Skip to contents

Validates that the provided data frame contains the specified column. It uses pre-existing checks to validate the data frame and the parameter name, then verifies that the given column exists in the data frame.

Usage

assert_dataframe_has_column(df, param_name)

Arguments

df

A data frame object to be validated.

param_name

Character. The name of the column to check in the data frame.

Value

This function does not return a value. It stops execution with an error message if the validations fail or if the column is not present.

Examples

if (FALSE) { # \dontrun{
  df <- data.frame(a = 1:5, b = 6:10)
  assert_dataframe_has_column(df, "a")
} # }