ezDuplicated: Which values are duplicated?

View source: R/util.R

ezDuplicatedR Documentation

Which values are duplicated?

Description

Keeps duplicated values by setting them to TRUE.

Usage

ezDuplicated(x, mode = "keepFirst")

Arguments

x

a vector, matrix or list.

mode

specifies how to keep duplicated values. Possible modes:

  • "keepFirst" uses duplicated() to keep duplicates in the original order.

  • "keepLast" keeps duplicates in a reversed order.

  • "random" keeps duplicates in a randomized order.

  • "all" keeps all duplicated values independent of the order.

Value

Returns a logical indicating which values are duplicated according to the specified mode.

Author(s)

Rehrauer, Hubert

Schmid, Peter

Examples

v1 = c(1,2,3,4,5,4,3,2,3,4,5,6,7,8,7)
ezDuplicated(v1)
ezDuplicated(v1,"all")

uzh/ezRun documentation built on Dec. 26, 2024, 9:53 a.m.