cleaner | R Documentation |
cleaner
removes duplicate entries from a data.frame
.
is_clean
checks whether a data.frame
has duplicate entries.
cleaned
shows which rows have been cleaned from a data.frame
with cleaner
cleaner(d, ufn, orderAlsoBy = character(), decr = FALSE)
is_clean(d, ufn = names(d))
cleaned(before, after)
d |
a |
ufn |
character, contains column names identifying unique entries ( |
orderAlsoBy |
optional character, specifies column name that |
decr |
logical, specifying if |
before |
a |
after |
a |
cleaner
returns a cleaned (i.e. deduplicated) data.frame
is_clean
returns a logical indicating whether duplicate entries were found
cleaned
returns a data.frame
containing the entries in before
that have been cleaned.
# clean heart rate data, only allow first measurement per person and condition
onlyfirst <- cleaner(heartrate, c("person", "condition"), "timestamp")
# alternatively, only allow last measurement
onlylast <- cleaner(heartrate, c("person", "condition"), "timestamp", TRUE)
# show whether 'heartrate' contains duplicates
is_clean(heartrate, c("person", "condition")) # returns false
# show entries cleaned from 'heartrate' compared to 'onlyfirst'
cleaned(heartrate, onlyfirst) # contains rows that were removed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.