Skip to contents

Returns unique(x) if all elements of x are identical, throws an error if not.

Usage

as_scalar(x)

Arguments

x

any object that can be handled by unique() (usually a vector or list)

Value

A scalar of the same type as x