Learn R Programming

tuple (version 0.4-02)

duplicate: Find Duplicate Values

Description

Finds values that occur exactly twice in a vector.

Usage

duplicate(x)

Arguments

x
A vector.

Details

Returns the duplicated values in the same order that they would be returned in a call to orphan. This fundamentally differs from duplicated, which returns a logical vector that is TRUE when it runs into any but the first occurrence of a value (and is therefore dependent on the direction of testing of the vector).

See Also

unique for similar output, and duplicated for the underlying calculations

Examples

Run this code
duplicate(c(NA, 1:3, 3, 4:6, 3, NA, 4))

Run the code above in your browser using DataLab