Description Usage Arguments Value Examples
View source: R/scr_duplicates.R
Fix any duplicates by dropping them.
1 | scr_duplicates(.data, .variables, action = c("keeplast", "keepfirst"))
|
.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. |
Data without duplicates from specific columns.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.