list_extract {listr}R Documentation

Extract an element from a list using tidy selection.

Description

This is pretty much an equivalent of calling '[[' on a list, but allows for cleaner use inside pipes.

Usage

list_extract(in_list, ...)

Arguments

in_list

The list to extract an element from.

...

A selection of what to extract. Must be a single element.

Value

The selected list element.

Examples

my_list <- list(rnorm(20), data.frame(x = 1:10, y = rnorm(10)), letters[1:5])
list_extract(my_list, 3)

[Package listr version 0.1.0 Index]