Learn R Programming

assertive (version 0.1-7)

use_first: Only use the first element of a vector.

Description

If the input is not scalar, then only the first element is returned, with a warning.

Usage

use_first(x)

Arguments

x
Input that should be scalar.

Value

  • If x is scalar, it is returned unchanged, otherwise only the first element is returned, with a warning.