getChangesOfDuplicates | R Documentation |
Get Changes of Rows That Are Duplicated in Selected Columns
getChangesOfDuplicates(df, columns, add_columns = columns)
df |
a data frame |
columns |
names of columns in |
add_columns |
names of additional columns that shall appear in the output even if there are no changes in these columns |
list of data frames. The list has as many elements as there are
different value combinations in columns
that appear more than once
in df
. Each element is a data frame with all rows from df
that have the same value combination in columns
. By default the data
frame contains the columns given in columns
and those columns out of
df
in which there is at least one change over the values in the
different rows.
df <- data.frame( id = 1:7, name = c("one", "one", "two", "two", "three", "three", "three"), type = c("A", "A", "B", "C", "D", "D", "D"), size = c(10, 11, 12, 12, 13, 13, 14), height = c(1, 1, 2, 3, 4, 4, 5) ) df getChangesOfDuplicates(df, "name") getChangesOfDuplicates(df, c("name", "type"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.