Indexing function for a list
pull_from_list(x, ..., fail_if_null = TRUE)
List to pull items from
List indices to pull. Can be either numeric or (preferably) a character.
(logical, default TRUE). Returns an informative error message if the list index is NULL. This function must always be named.
Use the ...
arguments to index the list. Not passing any ...
arguments
will return the entire list. The indexing will fail if either of two conditions are
met:
The index (which can be numeric or a key) does not exist in the list
If the index exists but the value of the item is NULL, and fail_if_null
is TRUE