list_filter {listr}R Documentation

Filter a list.

Description

Filter a list.

Usage

list_filter(in_list, filter_fun)

Arguments

in_list

The list to filter.

filter_fun

The function to use for filtering.

Details

'filter_fun' must evaluate to TRUE or FALSE for filtering, where elements returning TRUE are kept.

Value

A list, 'in_list' but filtered according to 'filter_fun.'

Examples

my_list <- list(aa = 1:3, bb =  1:4, cc = 2:5)
list_filter(my_list, function(x) min(x) == 1)
list_filter(my_list, function(x) max(x) > 3)

[Package listr version 0.1.0 Index]