This function performs a recursive search through a nested dictionary-like structure in R, looking for a specific term and collecting its values. It's useful for extracting specific pieces of data from complex, deeply nested results.
walk_nested_dict(my_result, term, outputs = list(), depth = 0, maxdepth = 25)
A list of values associated with the term found in the nested dictionary. Returns NULL if the term is not found or if maximum recursion depth is exceeded.
The nested dictionary-like structure to search through.
The term to search for within the nested dictionary.
An initially empty list to store the results of the search, default is an empty list.
The current depth of the recursion, default is 0.
The maximum depth to recurse, default is 25. If exceeded, the function issues a warning and returns NULL.