Learn R Programming

serpstatr (version 0.3.0)

sst_lists_to_df: 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)

Value

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

Arguments

lists

- a list of nested lists with different number of elements

fill

- a value to fill missing values in lists

Examples

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

Run the code above in your browser using DataLab