list_as_tibble: Convert a list of lists to a tibble

Description Usage Arguments Value See Also Examples

View source: R/tibble.R

Description

Convert a list of lists to a tibble

Usage

1
list_as_tibble(list_of_rows)

Arguments

list_of_rows

The list to be converted to a tibble

Value

A tibble with the same number of rows as there were elements in list_of_rows

See Also

tibble_as_list extract_row_to_list mapdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(purrr)

li <- list(
  list(a = 1, b = log10, c = "parrot") %>% add_class("myobject"),
  list(a = 2, b = sqrt, c = "quest") %>% add_class("yourobject")
)

tib <- list_as_tibble(li)

tib

Example output

# A tibble: 2 x 4
      a b      c      .object_class
  <dbl> <list> <chr>  <list>       
1     1 <fn>   parrot <chr [2]>    
2     2 <fn>   quest  <chr [2]>    

dynutils documentation built on March 22, 2021, 5:06 p.m.