Check list for redundancy

DESCRIPTION:

Check whether all elements of a list are identical

USAGE:

redundantList(x, reorder = F) 

REQUIRED ARGUMENTS:

x
a list.

OPTIONAL ARGUMENTS:

reorder
logical, if TRUE and components of x are lists, then those lists are reordered in alphabetical order by their names prior to doing the comparison; this is used for comparing lists which may have the same components in different order.

VALUE:

TRUE if all components of x are identical (after reordering), FALSE otherwise. If x has length 1, then always TRUE.

SEE ALSO:

, .

EXAMPLES:

redundantList(list(a = 1, b = 3:4)) # FALSE 
redundantList(list(a = 1, b = 1))   # TRUE 
# To test if all imputations are identical: 
redundantList(x)             # for an "miList" object 
redundantList(x@Imputations) # for an "miVariable" object