Drop decreasing counts

drop_decreasing(x, by, cols, k, strict)

Arguments

x

data.frame containing the column date

by

vector to group by

cols

vector of columns to clean

k

vector of lags (e.g., k=1:7 removes values that are decreasing with respect to any of the previous 7 values)

strict

logical indicating whether only strictly decreasing counts should be dropped

Value

x where decreasing counts are replaced with NA