Tibbles can have a list column

Extracting parts of a tibble with a list column:

# whole list column:
df |> pull(z) |> str()
## List of 2
##  $ :List of 2
##   ..$ : num 1
##   ..$ : num 2
##  $ :List of 3
##   ..$ : num 3
##   ..$ : num 4
##   ..$ : num 5
df |> pluck("z") |> str()
## List of 2
##  $ :List of 2
##   ..$ : num 1
##   ..$ : num 2
##  $ :List of 3
##   ..$ : num 3
##   ..$ : num 4
##   ..$ : num 5
# elements inside the list column:
df |> pluck("z", 2, 3)
## [1] 5
  • dplyr::pull() just takes one variable as argument
  • purrr::pluck() is designed to also take subsequent nested elements.