Skip to contents

Equivalent of .Filter() in Insight Maker when using arguments x and key in the filter function

Usage

IM_filter(y, condition_func)

Arguments

y

Named vector

condition_func

Function which takes arguments x and key and outputs a boolean value

Value

Vector with elements which meet condition_func

Examples

IM_filter(c(a = 1, b = 2, c = 3), function(x, key){x > 1})
#> b c 
#> 2 3 
# b c
# 2 3
IM_filter(c(a = 1, b = 2, c = 3), function(x, key){x > 1 & key != "b"})
#> c 
#> 3 
# c
# 3