list_select {listr}R Documentation

Select parts of a list.

Description

Select parts of a list.

Usage

list_select(in_list, ...)

Arguments

in_list

The list to select from.

...

The selection, can both be names and numeric positions.

Details

'list_select()' lets you select parts of a list either by position or by name. Names can be supplied as bare variable names and do not need to be supplied as strings or otherwise be quoted.

Elements are returned in the order they are given, this is useful if you want to reorder elements in a list. You can also rename while selecting, writing your selection like 'new_name = old_name'.

Value

A list of the selected elements.

Examples

my_list <- list(a = c(1, 2), b = c(3, 4), c(5, 6))
list_select(my_list, a, 3)

[Package listr version 0.1.0 Index]