check_columns_present: Check column names are present in a data.frame

View source: R/check-input-helpers.R

check_columns_presentR Documentation

Check column names are present in a data.frame

Description

The functions loops over the column names and checks whether they are present. If an issue is encountered, the function immediately stops and returns a message with the first issue encountered.

Usage

check_columns_present(data, columns)

Arguments

data

A data.frame or similar to be checked

columns

A character vector of column names to check

Value

Returns TRUE if the check was successful and a string with an error message otherwise.


epiforecasts/scoringutils documentation built on Dec. 11, 2024, 11:12 a.m.