sst_lists_to_df: Convert list of lists to data.frame

View source: R/utility_functions.R

sst_lists_to_dfR Documentation

Convert list of lists to data.frame

Description

API response might contain nested lists with different number of elements. This function fills missing elements and combine lists to a data.frame.

Usage

sst_lists_to_df(lists, fill = NA)

Arguments

lists

- a list of nested lists with different number of elements

fill

- a value to fill missing values in lists

Value

A data.frame with all missing values filed with specified value.

Examples

sst_lists_to_df(
  lists = list(
    first_list  = list(a = 1, b = 2),
    second_list = list(a = 2, c = 3)
  ),
  fill  = 'empty'
)

serpstatr documentation built on Sept. 9, 2023, 5:06 p.m.