sst_lists_to_df {serpstatr}R 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'
)

[Package serpstatr version 0.2.1 Index]