If unique(x)
is a single value, return it; otherwise, return an NA of the
same type as x
. If x
is a factor, then the levels and ordered status
will be kept in either case. If x
is a non-atomic vector (i.e. a list),
then the logical NA
will be used.
Author
Michael R. McLaren (orcid: 0000-0003-1575-473X)