Is there an R function that can detect if a loop is running, returning the index and variable name of that loop? I want to build a generalised function that can report the p