By default, `jsonlite::fromJSON` returns nested named lists. For mutable objects that we want to update in-place (e.g. adding `figures` to an `analysis`), it's more convenient to work with environments, since they are passed by reference.
response_to_JSON(response)parsed JSON where JSON objects are represented as environments and JSON arrays as R lists.
httr response
This helper converts named lists to environments recursively, while keeping unnamed lists (arrays) as lists of elements. Atomic values are returned as-is.