
Last chance! 50% off unlimited learning
Sale ends in
is_duplicated()
: a logical scalar if the data exist duplicated observations.
are_duplicated()
: a logical vector, the same length as the row number of data
.
duplicates()
: identical key-index data entries.
is_duplicated(data, key = id(), index)are_duplicated(data, key = id(), index, from_last = FALSE)
duplicates(data, key = id(), index)
A data frame for creating a tsibble.
Variable(s) that define unique time indices, used in conjunction
with the helper id()
. If a univariate time series (without an explicit key),
simply call id()
.
A bare (or unquoted) variable to specify the time index variable.
TRUE
does the duplication check from the last of identical
elements.
# NOT RUN {
harvest <- tibble(
year = c(2010, 2011, 2013, 2011, 2012, 2014, 2014),
fruit = c(rep(c("kiwi", "cherry"), each = 3), "cherry"),
kilo = sample(1:10, size = 7)
)
is_duplicated(harvest, key = id(fruit), index = year)
are_duplicated(harvest, key = id(fruit), index = year)
are_duplicated(harvest, key = id(fruit), index = year, from_last = TRUE)
duplicates(harvest, key = id(fruit), index = year)
# }
Run the code above in your browser using DataLab