duplicated_values {kim} | R Documentation |
Duplicated values in a vector
Description
Return all duplicated values in a vector. This function is a copy of the earlier function, find_duplicates, in Package 'kim'
Usage
duplicated_values(vector = NULL, na.rm = TRUE, sigfigs = 2, output = "summary")
Arguments
vector |
a vector whose elements will be checked for duplicates |
na.rm |
logical. If |
sigfigs |
number of significant digits to round to in the percent column of the summary (default = 2) |
output |
type of output. If |
Value
the output will be a data.table object (summary), a vector of duplicated values, or a vector non-duplicated values.
Examples
duplicated_values(mtcars$cyl)
duplicated_values(mtcars$cyl, output = "duplicated_values")
duplicated_values(vector = c(mtcars$cyl, 11:20, NA, NA))
duplicated_values(vector = c(mtcars$cyl, 11:20, NA, NA), na.rm = FALSE)
duplicated_values(vector = c(mtcars$cyl, 11:20, NA, NA),
na.rm = FALSE, sigfigs = 4, output = "duplicated_values")