Convert list of lists to tibble.
Arguments
- l
A list of lists.
- do_replace_list_nulls
A logical scalar: if
TRUE
, first replaceNULL
items in each sublist byNA
s.- do_bind_rows
A logical scalar: if
TRUE
, bind all tibbles by rows, otherwise return a list of tibbles.
Examples
lists_to_tibble(list(list(a = 1, b = 2), list(b = 3, a = 4, c = 5)))
#> # A tibble: 2 × 3
#> a b c
#> <dbl> <dbl> <dbl>
#> 1 1 2 NA
#> 2 4 3 5
lists_to_tibble(list(list(a = 1, b = 2), list(b = 3, a = 4, c = 5)), do_bind_rows = FALSE)
#> [[1]]
#> # A tibble: 1 × 2
#> a b
#> <dbl> <dbl>
#> 1 1 2
#>
#> [[2]]
#> # A tibble: 1 × 3
#> b a c
#> <dbl> <dbl> <dbl>
#> 1 3 4 5
#>