CheckLength: Check and adjust object length.

Description Usage Arguments Value

Description

Function that checks length of x. It may throw a stop(), warning(), and/or repeat the variable to create the desired length.

Usage

1
2
CheckLength(x, len, hard.stop = TRUE, warn.single = FALSE,
  par.name = character())

Arguments

x

object to check/adjust length of

len

desired length of object

hard.stop

if TRUE, stop when length(x) is neither 1 nor len. else, throw a warning and use repeat() to adjust length of x.

warn.single

if TRUE, through a warning when length(x) is 1 and it is being extended to a new length.

par.name

Character, used in the warning or stop message to indicate which parameter this warning is meant for.

Value

x updated to have length len, or throws exception


google/amss documentation built on May 20, 2019, 5:05 p.m.