I have a table of events with an indication when they happen. They are already ordered by time.
events <- data.frame(name=c("sow", "water", "harvest"), time=c("March", "May", "June"), stringsAsFactors = FALSE)
I want to get a list of all 2-element permutations of events which happened after each other (without the duplicates).
earlier later
sow water
sow harvest
water harvest
I know a couple of functions in R for getting some kind of combinations or permutations, but I have not found any that consider the order of appearance within the input.
Is there a function which does this, or do I have to implement my own?