Learn R Programming

omopgenerics (version 1.4.1)

validateNameStyle: Validate nameStyle argument. If any of the element in ... has length greater than 1 it must be contained in nameStyle. Note that snake case notation is used.

Description

Validate nameStyle argument. If any of the element in ... has length greater than 1 it must be contained in nameStyle. Note that snake case notation is used.

Usage

validateNameStyle(
  nameStyle,
  ...,
  empty = TRUE,
  nm = deparse1(substitute(nameStyle), backtick = TRUE),
  call = parent.frame()
)

Value

invisible nameStyle.

Arguments

nameStyle

A character vector. It must contain all the ... elements in snake_case format and between {}.

...

Elements to be included.

empty

Whether it can be empty.

nm

Name to use in error messages. Defaults to the expression supplied to nameStyle.

call

Call argument passed to cli functions.

Examples

Run this code
validateNameStyle(
  nameStyle = "hi_{cohort_name}",
  cohortName = c("cohort1", "cohort2"),
  otherVariable = c("only 1 value")
)

if (FALSE) {
validateNameStyle(
  nameStyle = "hi_{cohort_name}",
  cohortName = c("cohort1", "cohort2"),
  otherVariable = c("value1", "value2")
)
}
validateNameStyle(
  nameStyle = "{other_variable}_hi_{cohort_name}",
  cohortName = c("cohort1", "cohort2"),
  otherVariable = c("value1", "value2")
)

Run the code above in your browser using DataLab