colsCheck: Check that a data frame has certain columns

View source: R/checks.R

colsCheckR Documentation

Check that a data frame has certain columns

Description

colsCheck checks whether a data frame contains the specified columns. You can check for as many columns as you want, and the function will throw an informative error if any of them are missing (and it will tell you which ones) are missing. It will also check that obj is a data frame.

Usage

colsCheck(obj, cols)

Arguments

obj

An object that you want to check for cols

cols

A vector of column names you want to check for

Value

Throws an informative error if any of cols are missing from obj. Additionally throws an error if obj is not a data frame (see dfCheck())


MFEh2o/MFE_Utilities documentation built on May 6, 2023, 1:35 p.m.