get_constant_vars: Get Constant Variables

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Get Constant Variables

Usage

1
get_constant_vars(dataset, by_vars, ignore_vars = NULL)

Arguments

dataset

A data frame.

by_vars

By variables The groups defined by the by variables are considered separately. I.e., if a variable is constant within each by group, it is returned.

ignore_vars

Variables to ignore The specified variables are not considered, i.e., they are not returned even if they are constant (unless they are included in the by variables).

Permitted Values: A list of variable names or selector function calls like starts_with("EX")

Value

Variable vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(admiral.test)
data(vs)

admiral:::get_constant_vars(vs, by_vars = vars(USUBJID, VSTESTCD))

admiral:::get_constant_vars(
  vs,
  by_vars = vars(USUBJID, VSTESTCD),
  ignore_vars = vars(DOMAIN, tidyselect::starts_with("VS"))
)

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