Description Usage Arguments Value Examples
function to merge duplicate rows in a data.frame based on a set of id fields. other fields are concatenated together using paste(x, collapse="| "). This allows for cleaning based on all available information.
1 | mergeduplicates(df, idfields, sep = "|")
|
df |
Data frame containing duplicates |
idfields |
The fields that should be unique |
sep |
The separator to pass to |
The resulting data frame.
1 2 3 4 5 6 | df <- data.frame(x=c(1,2,3,4,1,2,3,4),
y=c(1,2,3,4,1,2,3,4),
label=c("one", "two", "three", "four",
"five", "six", "seven", "eight"))
df
mergeduplicates(df, idfields=c("x", "y"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.