chk_pars: Check Parameter Names

View source: R/chk-pars.R

chk_parsR Documentation

Check Parameter Names

Description

Checks if valid parameter names.

Usage

chk_pars(x, x_name = NULL)

vld_pars(x)

Arguments

x

An object.

x_name

A string of the name of object x or NULL.

Details

The character vector must consist of values that start with an alpha and only include alphanumeric characters and '_' or '.'.

Missing values and duplicates are permitted.

Value

The chk_ function throws an informative error if the test fails.

The vld_ function returns a flag indicating whether the test was met.

Functions

  • vld_pars(): Validate Parameter Names

Examples

x <- c("x", "a1._", "X")
chk_pars(x)
y <- c("x[1]", "a1", "a1", "._0")
try(chk_pars(y))
vld_pars(c("x", "a1._", "X"))
vld_pars(c("x[1]", "a1", "a1", "._0"))

poissonconsulting/extras documentation built on Jan. 18, 2024, 1:18 a.m.