Checking for scalar
is.scalar(x)
x
the input
Returns TRUE if x is a length one vector (i.e., a scalar)
TRUE