Learn R Programming

DataCombine (version 0.2.21)

FindDups: Find duplicated values in a data frame and subset it to either include or not include them.

Description

Find duplicated values in a data frame and subset it to either include or not include them.

Usage

FindDups(data, Vars, NotDups = FALSE, test = FALSE, ...)

Arguments

data
a data frame to select the duplicated values from.
Vars
character vector of variables in data to find duplicated values on.
NotDups
logical. If TRUE then a data frame without duplicated values is returned.
test
logical. If TRUE then the function will return an error if there are duplicated values.
...
arguments to pass to duplicated.

Value

a data frame, unless test = TRUE and there are duplicates.

Examples

Run this code
Data <- data.frame(ID = c(1, 1, 2, 2), Value = c(1, 2, 3, 4))

FindDups(Data, Vars = 'ID')

Run the code above in your browser using DataLab