remove_duplicates {basecamb} | R Documentation |
Remove duplicate rows from data.frame
Description
Removes rows that are duplicates of another row in all columns except exclude_columns
Usage
remove_duplicates(
data,
exclude_columns = NULL,
ID_column = NULL,
quiet = FALSE
)
Arguments
data |
data.frame to check |
exclude_columns |
character vector, these columns are not considered in determining whether two rows are equal |
ID_column |
character; column with identifiers to scan if possible duplicates remain |
quiet |
logical: Should messages be printed? |
Details
Wraps unique()
Value
vector of row indices with non-unique data
Author(s)
J. Peter Marquardt
Examples
data <- data.frame(Study_ID = c("A", "B", "C"), ID = c(123, 456, 123), num_cars = c(10, 2, 10))
remove_duplicates(data, exclude_columns = "Study_ID")
remove_duplicates(data, exclude_columns = "Study_ID", ID_column = "ID")
[Package basecamb version 1.1.5 Index]