required_items: Displays a error message when specified variables are not...

View source: R/required_items.R

required_itemsR Documentation

Displays a error message when specified variables are not present in data

Description

Displays a error message when specified variables are not present in data

Usage

required_items(
  data,
  items,
  message = "The following variable(s) need to be present in data:"
)

Arguments

data

A data frame.

items

Specify the variables that must be present in a data frame to use a function or run an R script. Variables should be listed using the c() function, and each variable name should be quoted. For example, "items = c("Var1", "Var2").

message

The message that returns when specified variable(s) are missing. By default, "The following variable(s) need to be present in data:"

Value

A error message if specified variable is missing.


jpetrovich02/CCMHr documentation built on Jan. 25, 2024, 11:57 p.m.