This function recurses through a ShojiOrder or OrderGroup and
removes any duplicate entities. As with base::duplicated,
the first appearance of an entity is kept, and subsequent occurrences are marked as duplicated
and removed. (Unlike duplicated, there is no option to reverse that order.)
The first occurrence of an entity is determined by the function's recursion:
within each group, nested groups are processed first, in order, and
their nested groups are processed recursively. See the test suite, in
test-variable-order.R, for an example that illustrates which entities are
dropped as duplicate.
dedupeOrder(x)VariableOrder, DatasetOrder, VariableGroup, or DatasetGroup
x with duplicate entities removed.
duplicates, which when set to FALSE also calls this function.