Skip to contents

Ensures that a vector or scalar is named according to standard rules

Usage

.ensureLimitsAreNamed(x, decreasing = FALSE, nameStrings = NULL)

Arguments

x

the vector (or scalar) to be named

decreasing

if naming is required, how should x be sorted?

nameStrings

an optional vector that provides the names to be used. See Usage Notes below

Value

If x is NULL or named, it is returned unaltered. Otherwise, it is first sorted according to descending and then names from names are assigned in order.

Usage Notes

If nameStrings is not NULL, its length must be greater than or equal to the length of x. Otherwise, names are determined as follows: If length(x) is 1, the name of nameString's single element is "action" 2, the names of nameString's elements are "action" and "warn", in that order 2 or more, nameString's elements are the character equivalent of the integers 1 to length(x). Otherwise t