Skip to contents

This function converts a complex list-based response (from an API or other source) into a tibble. It handles different types of list structures, including flat responses, search results (with rows), and metabolite entries with DATA values.

Usage

response_to_df(response)

Arguments

response

A list that can be in various forms:

  • Flat named list (single record)

  • Search results with rows (e.g., Row1, Row2)

  • Metabolite entries with DATA elements (e.g., measurement data)

Value

A tibble with the processed data, where each element is converted into a column. If DATA columns are NULL, they are replaced with NA.