findRepeated: Find repeated elements

View source: R/findRepeated.R

findRepeatedR Documentation

Find repeated elements

Description

findRepeated gets index of repeated items/values in vector 'x' (will be treated as character). Return (named) list of indexes for each of the repeated values, or NULL if all values are unique. This approach is similar but more basic compared to get1stOfRepeatedByCol.

Usage

findRepeated(x, nonRepeated = FALSE, silent = FALSE, callFrom = NULL)

Arguments

x

character vector

nonRepeated

(logical) if =TRUE, return list with elements $rep and $nonrep

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of message(s) produced

Value

(named) list of indexes for each of the repeated values, or NULL if all values unique

See Also

similar approach but more basic than get1stOfRepeatedByCol

Examples

aa <- c(11:16,14:12,14); findRepeated(aa) 

wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.