check_length: Check if valid input length
Description
Check if valid input length
Usage
check_length(x, length, name)
Arguments
- x
Scaler or vector
- length
Length of x.
- name
Name of x for displaying errors.
Details
Check if x has approprate length. If length of x is 1 then x is
replicated to match length. If length of x is neither 1 or length then
an error is signaled.