Modify a multilist from API JSON output to a level 1 tibble

multilist_to_tibble(the_list)

Arguments

the_list

list of element as issued from a API REST call

Value

a tibble with columns as the names of the list

Examples

reprex <- list(
  list(a = 1, b = list("email1", "email2", "email3"), c = list("3")),
  list(a = 5, b = list("email1"), c = list("4")),
  list(a = 3, b = NULL, c = list("3", "2"))
)

multilist_to_tibble(reprex)
#> # A tibble: 3 × 3
#>       a b            c           
#>   <dbl> <named list> <named list>
#> 1     1 <list [3]>   <list [1]>  
#> 2     5 <list [1]>   <list [1]>  
#> 3     3 <lgl [1]>    <list [2]>