Skip to contents

list_as_tibble() converts a list to a tibble, pivoting it to long format.

Usage

list_as_tibble(list)

Arguments

list

A list to be converted.

Value

A tibble with two columns: name and value, where name corresponds to the original list element names and value to their respective values as character` strings.

See also

Other parsing/conversion functions.: vector_to_c()

Examples

list(a = 1, b = "a", c = TRUE) |>
  list_as_tibble()
#> # A tibble: 3 × 2
#>   name  value
#>   <chr> <chr>
#> 1 a     1    
#> 2 b     a    
#> 3 c     TRUE