Learn R Programming

crunch (version 1.24.0)

dedupeOrder: Remove duplicated entities from an order/group

Description

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.

Usage

dedupeOrder(x)

Arguments

x

VariableOrder, DatasetOrder, VariableGroup, or DatasetGroup

Value

x with duplicate entities removed.

See Also

duplicates, which when set to FALSE also calls this function.