I am having trouble figuring out how to filter for groups in a dataframe that increase by descending order. I would start with an input:
df <- structure(list(Animal = c("Cat", "Cat", "Cat", "Cat", "Cat",
"Cat", "Dog", "Dog", "Dog", "Dog", "Rat", "Rat", "Rat", "Rat",
"Rat"), Value = c(2L, 3L, 5L, 8L, 19L, 20L, 4L, 8L, 19L, 33L,
4L, 8L, 15L, 10L, 25L)), class = "data.frame", row.names = c(NA,
-15L))
In this case, I want my output to only show groups "Dog" and "Cat" since it is consistently increasing. Rat, however, would be left out at it goes from 8 to 15 to 10.
Any help would be appreciated. Thanks!