assert_has_variables: Does a Dataset Contain All Required Variables?

Description Usage Arguments Value Author(s) Examples

View source: R/assertions.R

Description

Checks if a dataset contains all required variables

Usage

1
assert_has_variables(dataset, required_vars)

Arguments

dataset

A data.frame

required_vars

A character vector of variable names

Value

The function throws an error if any of the required variables are missing in the input dataset

Author(s)

Thomas Neitmann

Examples

1
2
3
4
5
6
7
8
library(admiral.test)
data(dm)

assert_has_variables(dm, "STUDYID")
## Not run: 
assert_has_variables(dm, "AVAL")

## End(Not run)

epijim/admiral documentation built on Feb. 13, 2022, 12:15 a.m.