scr_duplicates: Fix any duplicates by dropping them.

Description Usage Arguments Value Examples

View source: R/scr_duplicates.R

Description

Fix any duplicates by dropping them.

Usage

1
scr_duplicates(.data, .variables, action = c("keeplast", "keepfirst"))

Arguments

.data

Data with duplicates.

.variables

Variables (columns) to use as the basis for determining duplicates.

action

The action to take for duplicates:

- "keeplast": Keep the last duplicate value.
- "keepfirst": Keep the first duplicate value.

Value

Data without duplicates from specific columns.

Examples

1
2
3
4
5
6
7
ds <- data.frame(
a = c(rep(1, 3), rep(2, 3)),
b = c(1:3, 1, 1, 2),
v = rnorm(6)
)
ds %>%
scr_duplicates(c("a", "b"), "keepfirst")

lwjohnst86/PROMISE.scrub documentation built on May 21, 2019, 9:01 a.m.