Check if valid input length
check_length(x, length, name)
x
length
name
x.
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.
Useful links