Is there an easy way (or any way) to extract the row number of the nth occurrence of some condition in R in a data frame? Let's say I have a data frame with 30 columns, all the same types of values. I want to extract the row number from each column in which the 2nd occurrence of some condition happens. It's quite simple to extract the count of all rows that match the condition, but I can't figure out how to extract the row that matches the nth occurrence of the condition.Is there an easy way (or any way) to extract th