Suppose I have a couple of toy dataframes in R:
ToyDF_1 <- as.data.frame(c(12,10,8,10,12,6,10))
ToyDF_2 <- as.data.frame(c(12,10,10,7,12,6,10))
My question is quite simple conceptually, but I haven't been able to find a solution for it. I would like to know how to get the index of the FIRST minimum of these dataframes. So in this case, a way to fetch index 3 in the first dataframe, and 4 in the second.
I do not know beforehand where this first minimum might show up, and the only built-in function that exists in R (which.min) only fetches the row index of the global minimum.
I believe a way out may be to consider differences with regards to the previous element, but not sure how to make it.