tibble_as_list: Convert a tibble to a list of lists

Description Usage Arguments Value See Also Examples

View source: R/tibble.R

Description

Convert a tibble to a list of lists

Usage

1

Arguments

tib

A tibble

Value

A list with the same number of lists as there were rows in tib

See Also

list_as_tibble extract_row_to_list mapdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(tibble)

tib <- tibble(
  a = c(1, 2),
  b = list(log10, sqrt),
  c = c("parrot", "quest"),
  .object_class = list(c("myobject", "list"), c("yourobject", "list"))
)

li <- tibble_as_list(tib)

li

Example output

[[1]]
$a
[1] 1

$b
function (x)  .Primitive("log10")

$c
[1] "parrot"

attr(,"class")
[1] "myobject" "list"    

[[2]]
$a
[1] 2

$b
function (x)  .Primitive("sqrt")

$c
[1] "quest"

attr(,"class")
[1] "yourobject" "list"      

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